29.06.2009, 10:33
Код:
f(!strcmp(cmdtext, "/cuff", true,4)) { if(playerDB[playerid][specialybe]!=1){SendClientMessage(playerid,sviesiaigeltona,"* This command only for cops"); return 1;} if(cmdtext[4]==0){SendClientMessage(playerid,melyna,"* cuff player /cuff [partofname]"); return 1;} new vardas[MAX_PLAYER_NAME]; strmid(vardas,cmdtext[5],0,MAX_PLAYER_NAME); new id = GetPlayeridMid(vardas); if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, melyna, "* Wrong name."); return 1;} if (id == playerid){ SendClientMessage(playerid, melyna, "* You can't cuff yourself"); return 1;} new Float:Coo[3]; GetPlayerPos(id,Coo[0],Coo[1],Coo[2]); if(!PlayerToPoint(3, playerid, Coo[0],Coo[1],Coo[2])){SendClientMessage(playerid, melyna, "* Player too far."); return 1;} new msg[128],police[MAX_PLAYER_NAME]; GetPlayerName(playerid,police,sizeof(police)); GetPlayerName(id,vardas,sizeof(vardas)); if(playerDB[id][cuffed]) { playerDB[id][cuffed]=false; TogglePlayerControllable(id,false); format(msg,sizeof(msg),"cuffed %s.",vardas); SendClientMessage(playerid,melyna,msg); format(msg,sizeof(msg)," you've been cuffed by %s .",police); SendClientMessage(id,melyna,msg); }else{ playerDB[id][cuffed]=true; TogglePlayerControllable(id,true); format(msg,sizeof(msg),"Uncuff %s.",vardas); SendClientMessage(playerid,melyna,msg); format(msg,sizeof(msg),"you'v been uncuffed by %s.",police); SendClientMessage(id,melyna,msg); } return 1; }
Код:
if(strcmp(cmdtext, "/pickup", true)==0) { new vardas[MAX_PLAYER_NAME]; new id = GetPlayeridMid(vardas); if(playerDB[id][cuffed]) { SendClientMessage(playerid,zalia, "You're cuffed"); return 1; } SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); return 1; }