07.03.2009, 12:25
Код:
dcmd_jail(playerid,params[]) { if(gTeam[playerid] != TEAM_COP) return SendClientMessage(playerid,COLOR_RED,"LSPD only!"); new giveplayer = strval(params); if (strlen(params)<=0) return SendClientMessage(playerid,COLOR_WHITE,"/jail [ID]"); if (!IsPlayerConnected(giveplayer)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected."); else { new string[256],pidname[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pidname,256); GetPlayerName(giveplayer,pname,256); format(string,sizeof(string),"Cop %s jailed you!",pidname); SendClientMessage(giveplayer,COLOR_GREY,string); format(string,sizeof(string),"You jailed %s!",pname); SendClientMessage(playerid,COLOR_GREY,string); SetPlayerPos(giveplayer,264.8447,77.5486,1001.0391); SetPlayerInterior(giveplayer,6); SetPlayerFacingAngle(giveplayer,266.6938); ResetPlayerWeapons(giveplayer); SetPlayerArmour(giveplayer,0.0); SendClientMessage(giveplayer, COLOR_WHITE, "Your items where confiscated and destroyed!"); return true; } new pName[MAX_PLAYER_NAME]; new string[48]; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "%s has joined the server.", pName); SendClientMessageToAll(0xAAAAAAAA, string); SetPlayerColor(playerid,COLOR_WHITE); GivePlayerMoney(playerid,2000); return 1; }
and this is OnPlayerCommandText
Код:
dcmd(jail,4,cmdtext);