09.10.2016, 21:42
(
Последний раз редактировалось iamjems; 17.10.2016 в 18:09.
)
Ok. So my ID in game is 30. When I do /setskin 30 SKIN_ID it messages me, You have set James Tyson's skin to ID SKIN_ID but does not return Admin James Tyson has set your skin to SKIN_ID unless the skin_id is the same as my ID, in this case it's 30.
also, how do i get it to return i.e. if i type /setskin la la it returns USAGE: /setskin <playerid> <skinid>? im using sscanf2. and can anyone explain what do numbers here: new msg[256] and other thingies similar to this mean?
Код:
CMD:setskin(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new idx; new id[256]; new tmp[512]; id = strtok(params,idx); tmp = strtok(params,idx); SetPlayerSkin(strval(id),strval(tmp)); new msg[256]; new msg2[256]; new pName[MAX_PLAYER_NAME]; new admName[MAX_PLAYER_NAME]; GetPlayerName(strval(id),pName,MAX_PLAYER_NAME); GetPlayerName(playerid,admName,MAX_PLAYER_NAME); format(msg,256,"{666666}ADMCMD:{FFFF00} You have set %s's skin to %d.", UnderscoreToSpaceName(strval(id)), strval(tmp)); format(msg2,256,"Admin %s has set your skin to %d.", UnderscoreToSpaceName(playerid), strval(tmp)); SendClientMessage(playerid, COLORNOTIF, msg); SendClientMessage(strval(tmp), COLORWHITE, msg2); } else return SendClientMessage(playerid, COLORERROR, "You are not authorized to use this command."); return 1; }