31.08.2015, 16:45
Код:
CMD:slap(playerid,id,Float:x,Float:y,Float:z,params[])// what ever varaible you want define it here in CMD as you // in most cmds we need id and x/y/z or some other other varaible i think you should allow to use them in cmd. { if(pInfo[playerid][pLevel] >= 1 ) { // new id,Float:x, Float:y, Float:z, Float:Health; // rather than defining here if(sscanf(params, "u", id)) return SCM(playerid, yellow, "SERVER : /slap <Player ID>"); if(!IsPlayerConnected(id)) return ShowMessage(playerid, red, 2); if(pInfo[playerid][pLevel] < pInfo[id][pLevel] ) return ShowMessage(playerid, red, 6); format(Jstring,sizeof(Jstring),"You have slapped '%s'",GetName(id)); SCM(playerid,yellow,Jstring); GetPlayerHealth(id,Health); SetPlayerHealth(id,Health-15); GetPlayerPos(id, x, y, z); SetPlayerPos(id,x,y,z+6); return 1; } else return ShowMessage(playerid, red, 1); }