[pomoc]tazer

Započeo ‹Fox›, Januar 28, 2011, 16:05:13 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Radio sam komandu tazer i stavio da unfreezea igraca nakon 8sec i kad sam isao testat nije ga unfreezalo
ovo sam dodao na vrh:
new suspect;
komanda tazer:
if(strcmp(cmdtext, "/tazer", true) ==0)
{
    if(IsPlayerConnected(playerid))
    {
if(org[playerid] == 1 || leader[playerid] == 1)
{
    if(IsPlayerInAnyVehicle(playerid))

    {
        SendClientMessage(playerid, COLOR_GREY, "Nemozete koristiti /tazer dok ste u vozilu");
        return 1;
    }
    suspect = GetClosestPlayer(playerid);
    if(IsPlayerConnected(suspect))
{
    if(cuffed[suspect] > 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "Igrac je vec uhicen.");
        return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
    if(IsPlayerInAnyVehicle(suspect))
    {
        SendClientMessage(playerid, COLOR_GREY, "Taj igrac je u vozilu.");
        return 1;
    }
    new string[128];
format(string, sizeof(string), "*Policajac %s vas je sokirao na 8 sekundi.", PlayerName(playerid));
SendClientMessage(suspect, COLOR_NEWBLUE, string);
format(string, sizeof(string), "*Sokirao si igraca %s na 8 sekundi.", PlayerName(suspect));
SendClientMessage(playerid, COLOR_NEWBLUE, string);
format(string, sizeof(string), "* Policajac %s je sokirao igraca %s na 8 sekundi.", PlayerName(playerid), PlayerName(suspect));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(suspect, "~r~Sokiran", 2500, 3);
TogglePlayerControllable(suspect, 0);
SetTimer("tazer2", 8000, false);
tazer[suspect] = 1;
cuffedtime[suspect] = 8;
            }
else
{
    SendClientMessage(playerid, COLOR_GREY, " Nema nikoga blizu vas");
    return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niste clan PD/FBI/SWAT-a.");
}
}//not connected
    return 1;
}


i na dnu(ovo je od timera):
forward tazer2(playerid);
public tazer2(playerid)
{
if(tazer[playerid] > 0)
{
TogglePlayerControllable(playerid, 1);
}
return 1;
}