22.02.2010, 19:14
Hello.
I made a Costody script, but
I can only release id 0.
This is my script. What have I done wrong?
I made a Costody script, but
I can only release id 0.
This is my script. What have I done wrong?
pawn Код:
if(strcmp(cmd, "/rcostody",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(6.0, playerid, 222.9323,69.8237,1005.0391))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!");
return 1;
}
if(PlayerInfo[giveplayerid][pCostody] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " The selected player is not in costody!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /rcostody [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You released %s from costody.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* You have been released from costody by Officer %s.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pCostody] = 0;
SetPlayerPos(giveplayerid, 222.9323,69.8237,1005.0391);
}
}
}
}
}
return 1;
}