31.07.2015, 18:55
Hello again!
I am creating my own admin filterscript with MySQL sscanf and zcmd.
My problem:
Check out this code:
When I type /goto 0 it shows me again this: Usage: /goto [Playerid]
Please can you help me fast? +1 Rep if someone helps.
I am creating my own admin filterscript with MySQL sscanf and zcmd.
My problem:
Check out this code:
PHP код:
CMD:goto(playerid,params[]){
new id,str[256],name[MAX_PLAYER_NAME];
if(sscanf(params,"i",id))return SendClientMessage(playerid,-1,"{FF9900}Usage:{FFFFFF} /goto [Playerid]");
if(!IsConnect(id))return SendClientMessage(playerid,-1,"Player{FF0000} not{FFFFFF} found");
if(IsPlayerInDMgoto[playerid] != 0) return SendClientMessage(playerid, -1, "{FFFFFF}You{FF0000} can't{FFFFFF} goto this player while on DM!");
if(P_DATA[id][Agoto] == false)return SendClientMessage(playerid,-1,"{FFFFFF}You{FF0000} can't{FFFFFF} goto to this player because he disabled it.");
new Float:Pos[4];
GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(id,Pos[3]);
if(IsPlayerInAnyVehicle(playerid)){
SetVehiclePos(GetPlayerVehicleID(playerid),Pos[0],Pos[1],Pos[2]);
}
else{
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SetPlayerFacingAngle(playerid,Pos[3]);
}
GetPlayerName(id,name,sizeof(name));
format(str,sizeof(str),"You have teleported to '{FFFF00}%s{FFFFFF}'.",name);
SendClientMessage(playerid,-1,str);
return 1;
}
Please can you help me fast? +1 Rep if someone helps.