11.06.2012, 15:02
Having some trouble with my admin side of the script. Maybe someone can point out what I'm doing wrong? thanks in advance
Код:
CMD:goto(playerid, params[]) { if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command "); new targetid, string[128]; if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /goto [PlayerID/PartOfName]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!"); else { new pName[24]; GetPlayerName(targetid,pName,128); format(string, sizeof(string), ""#COL_YELLOW"[ADMIN]"#GREEN" You succesfully teleported to [%d] %s.",targetid, pName); SendClientMessage(playerid,COLOR_RED,string); SetPlayerInterior(playerid,GetPlayerInterior(targetid)); new Float:TPX, Float:TPY, Float:TPZ; GetPlayerPos(targetid, TPX, TPY, TPZ); SetPlayerPos(playerid, TPX, TPY, TPZ+1); } return 1; }