[pomoc]telefon

Započeo ‹Fox›, Oktobar 08, 2010, 12:54:32 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

imam komandu call pickup i hangup i ja na laptopu i kompu, na laptopu upisem "call broj" a na kompu /pickup i normalno je sve ali kad napisem nesta pise meni 2-3 puta to sta sam napiso i tak je sve pomjesano
evo komandi i onplayertext
komande:
if(strcmp(cmd, "/pickup", true) == 0 || strcmp(cmd, "/p", true) == 0)
{
        if(IsPlayerConnected(playerid))
{
if(Mobile[playerid] != 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vec ste u razgovoru");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Mobile[i] == playerid)
{
PlayerInfo[playerid][pJavljanje] = 1;
PlayerInfo[i][pJavljanje] = 1;
Mobile[playerid] = i; //caller connecting
SendClientMessage(i,  COLOR_GRAD2, "   Korisnik se javio na mobitel.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s se javlja na mobitel.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RingTone[playerid] = 0;
}

}
}
}
return 1;
}
if(strcmp(cmd, "/hangup", true) == 0 || strcmp(cmd, "/h", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
new caller = Mobile[playerid];
if(IsPlayerConnected(caller))
{
    if(caller != INVALID_PLAYER_ID)
    {
if(caller != 255)
{
if(caller < 255)
{
PlayerInfo[playerid][pJavljanje] = 0;
PlayerInfo[caller][pJavljanje] = 0;
SendClientMessage(caller,  COLOR_GRAD2, " korisnik je prekinuo razgovor");
CellTime[caller] = 0;
CellTime[playerid] = 0;
SendClientMessage(playerid,  COLOR_GRAD2, " Prekinuli ste razgovor");
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
RingTone[playerid] = 0;
return 1;
}
}
}
SendClientMessage(playerid,  COLOR_GRAD2, "  spremili ste mobitel u dzep");
}
return 1;
}
if(strcmp(cmd, "/call", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristiti: /call [broj]");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "  nemate mobitel, mozete ga kupiti u 24/7");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s vadi svoj mobitel.", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new phonenumb = strval(tmp);
if(phonenumb == 911)
{
SendClientMessage(playerid, COLOR_WHITE, "Koristite tipku T za pricanje, za prekid koristite /hangup");
SendClientMessage(playerid, COLOR_ALLDEPT, "trazite li policiju ili bolnicu?");
SendClientMessage(playerid, COLOR_ALLDEPT, "Recite nam vasu lokaciju");
Mobile[playerid] = 911;
return 1;
}
if(phonenumb == PlayerInfo[playerid][pPnumber])
{
SendClientMessage(playerid, COLOR_GRAD2, " Korisnik je trenutno zauzet...");
return 1;
}
if(Mobile[playerid] != 255)
{
SendClientMessage(playerid, COLOR_GRAD2, " Vec razgovarate...");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayeridp = i;
Mobile[playerid] = giveplayeridp; //caller connecting
if(IsPlayerConnected(giveplayeridp))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(PhoneOnline[giveplayeridp] > 0)
        {
            SendClientMessage(playerid, COLOR_GREY, " Taj igrac ima ugasen mobitel !");
            return 1;
        }
if (Mobile[giveplayerid] == 255)
{
PlayerInfo[playerid][pJavljanje] = 1;
PlayerInfo[giveplayeridp][pJavljanje] = 1;
format(string, sizeof(string), "zove vas %s, upisite (/p)ickup za javiti se", sendername);
SendClientMessage(giveplayeridp, COLOR_YELLOW, string);
GetPlayerName(giveplayeridp, sendername, sizeof(sendername));
RingTone[giveplayerid] = 10;
format(string, sizeof(string), "* %s ima poziv", sendername);
SendClientMessage(playerid, COLOR_WHITE, "Koristite T za pricanje, za prekid razgovora upisite (/h)angup");
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
CellTime[playerid] = 1;
return 1;
}
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "  You just get a Busy tone...");
}
return 1;
}

onplayertext:
if(PlayerInfo[playerid][pJavljanje] == 1 && PlayerInfo[giveplayeridp][pJavljanje] == 1)
{
  new string[128],
   Ime[MAX_PLAYER_NAME];
   new Ime2[MAX_PLAYER_NAME];
   new string2[128];
   GetPlayerName(playerid,Ime, MAX_PLAYER_NAME);
    GetPlayerName(giveplayeridp,Ime2, MAX_PLAYER_NAME);
   format(string, sizeof(string), "%s (mobitel): %s ", Ime, text);
   SendClientMessage(giveplayeridp, COLOR_YELLOW, string);
   format(string2, sizeof(string2), "%s (mobitel): %s ", Ime2, text);
   SendClientMessage(playerid, COLOR_YELLOW, string);
   ProxDetector(15.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
   }
   else
   {
   new
   string[128],
   Ime[MAX_PLAYER_NAME];
   GetPlayerName(playerid,Ime, MAX_PLAYER_NAME);
   format(string, sizeof(string), "%s kaze: %s ", Ime, text);
   ProxDetector(15.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
   return 0;
   }
   return 1;
}

Pise ti vise puta ako su ti oba lika jedan kraj drugog

ne, komp je u SF-u a laptop u LS-u...