06.03.2011, 21:02
Hi Guys, i have a problem with goto code.
Any errors or Warnings, but don't Work. What's wrong in this code? Thank's ^^
P.S: I added dcmd(goto,4,cmdtext); in OnPlayerCommandText.
Код:
dcmd_goto(playerid,params[]) { new id, n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME]; new tmp[256], Index, str[49]; tmp = strtok(params,Index), id = strval(tmp); GetPlayerName(id,on,sizeof(on)); GetPlayerName(playerid,n,sizeof(n)); if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,ORANGE,"You need to be level 3 to use this command!"); if(!strlen(params)) return SendClientMessage(playerid,GREY,"USAGE: /goto <ID> "); if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREY,"Invalid ID"); format(str,sizeof(str),"Admin %s has teleported to %s",n,on); SendClientMessageToAll(ORANGE,str); new Float:x, Float:y, Float:z; GetPlayerPos(id, x, y, z); SetPlayerPos(playerid, x+1, y+1, z); return 1; }
P.S: I added dcmd(goto,4,cmdtext); in OnPlayerCommandText.