Cuff everything works exept 1 thing
#1

Hello,

I've made my own /cuff script but if I use it it also cuffs the ID 0. It cuffs the /cuff [ID] and ID 0 how can I fix that only the ID that I want to cuff gets cuffed?

pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /cuff [playerid]");
            return 1;
        }
        new playa;
        if(IsStringAName(tmp))
        {
            playa = GetPlayerID(tmp);
        }
        else
        {
            playa = strval(tmp);
        }
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if (gTeam[playerid] == TEAM_BLUE)
        {
            TogglePlayerControllable(playa, 0);
            LoopingAnim(giveplayerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
            SendClientMessage(giveplayerid, COLOR_YELLOW, "You've got handcuffed by a officer.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "You are not a cop!");
        }
        return 1;
    }

//-------------------------------[Cuff]-------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
    if(strcmp(cmd, "/uncuff", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /uncuff [playerid]");
            return 1;
        }
        new playa;
        if(IsStringAName(tmp))
        {
            playa = GetPlayerID(tmp);
        }
        else
        {
            playa = strval(tmp);
        }
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if (gTeam[playerid] == TEAM_BLUE)
        {
            TogglePlayerControllable(playa, 1);
            SendClientMessage(giveplayerid, COLOR_YELLOW, "You've got released by a officer.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "You are not a cop!");
        }
        return 1;
    }
Reply


Messages In This Thread
Cuff everything works exept 1 thing - by joeri55 - 10.06.2009, 20:26
Re: Cuff everything works exept 1 thing - by Geekzor - 10.06.2009, 20:44
Re: Cuff everything works exept 1 thing - by joeri55 - 10.06.2009, 21:39

Forum Jump:


Users browsing this thread: 4 Guest(s)