SA-MP Forums Archive
Cuff everything works exept 1 thing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Cuff everything works exept 1 thing (/showthread.php?tid=81425)



Cuff everything works exept 1 thing - joeri55 - 10.06.2009

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;
    }



Re: Cuff everything works exept 1 thing - Geekzor - 10.06.2009

hmmm i dont know much about this but what should happens if u write MAX_PLAYERS ? it cuff all on server or it can cuff only someone that u want ... dont be angry if i tell wrong here heh u know scripter beginer


Re: Cuff everything works exept 1 thing - joeri55 - 10.06.2009

Max players? Please don't talk about something that you never heared off.