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;
}
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
Max players? Please don't talk about something that you never heared off.