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;
}
CMD:goto(playerid, params[]) { new targetid = INVALID_PLAYER_ID; if (sscanf(params, "u", targetid)) return SendClientMessage(playerid,-1,"{FF9900}Usage:{FFFFFF} /goto [Playerid]"); if (IsPlayerConnected(targetid) && targetid != INVALID_PLAYER_ID) { if (IsPlayerInDMgoto[playerid]) return SendClientMessage(playerid, -1, "{FFFFFF}You{FF0000} can't{FFFFFF} goto this player while on DM!"); if (!P_DATA[targetid][Agoto]) return SendClientMessage(playerid, -1, "{FFFFFF}You{FF0000} can't{FFFFFF} goto to this player because he disabled it."); new Float:pos[4]; GetPlayerFacingAngle(targetid, pos[3]); GetPlayerPos(targetid, pos[0], pos[1], pos[2]); 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]); } new str[67], name[MAX_PLAYER_NAME]; GetPlayerName(targetid, name, sizeof(name)); format(str, sizeof(str), "You have teleported to '{FFFF00}%s{FFFFFF}'.", name); SendClientMessage(playerid, -1, str); } else SendClientMessage(playerid,-1,"Player{FF0000} not{FFFFFF} found"); return 1; }
At a glance the command seems to be fine, but try with this command .
Код:
CMD:goto(playerid, params[]) { new targetid = INVALID_PLAYER_ID; if (sscanf(params, "u", targetid)) return SendClientMessage(playerid,-1,"{FF9900}Usage:{FFFFFF} /goto [Playerid]"); if (IsPlayerConnected(targetid) && targetid != INVALID_PLAYER_ID) { if (IsPlayerInDMgoto[playerid]) return SendClientMessage(playerid, -1, "{FFFFFF}You{FF0000} can't{FFFFFF} goto this player while on DM!"); if (!P_DATA[targetid][Agoto]) return SendClientMessage(playerid, -1, "{FFFFFF}You{FF0000} can't{FFFFFF} goto to this player because he disabled it."); new Float:pos[4]; GetPlayerFacingAngle(targetid, pos[3]); GetPlayerPos(targetid, pos[0], pos[1], pos[2]); 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]); } new str[67], name[MAX_PLAYER_NAME]; GetPlayerName(targetid, name, sizeof(name)); format(str, sizeof(str), "You have teleported to '{FFFF00}%s{FFFFFF}'.", name); SendClientMessage(playerid, -1, str); } else SendClientMessage(playerid,-1,"Player{FF0000} not{FFFFFF} found"); return 1; } |
CMD:goto(playerid,params[]) { new id,str[128],name[MAX_PLAYER_NAME]; if(sscanf(params,"u",id)) { SendClientMessage(playerid,-1,"{CACA00}[INFO]{FFFFFF}: /goto (Player Name/ID)"); return 1; } if(!IsConnect(id)) { SendClientMessage(playerid,-1,"Player{FF0000} not{FFFFFF} found"); return 1; } if(IsPlayerInDMgoto[playerid] != 0) { SendClientMessage(playerid, -1, "{FFFFFF}You{FF0000} can't{FFFFFF} goto this player while on DM!"); return 1; } if(P_DATA[id][Agoto] == false) { SendClientMessage(playerid,-1,"{FFFFFF}You{FF0000} can't{FFFFFF} goto to this player because he disabled it."); return 1; } 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; }
It should work now.
Код:
CMD:goto(playerid,params[]) { new id,str[128],name[MAX_PLAYER_NAME]; if(sscanf(params,"u",id)) { SendClientMessage(playerid,-1,"{CACA00}[INFO]{FFFFFF}: /goto (Player Name/ID)"); return 1; } if(!IsConnect(id)) { SendClientMessage(playerid,-1,"Player{FF0000} not{FFFFFF} found"); return 1; } if(IsPlayerInDMgoto[playerid] != 0) { SendClientMessage(playerid, -1, "{FFFFFF}You{FF0000} can't{FFFFFF} goto this player while on DM!"); return 1; } if(P_DATA[id][Agoto] == false) { SendClientMessage(playerid,-1,"{FFFFFF}You{FF0000} can't{FFFFFF} goto to this player because he disabled it."); return 1; } 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; } |
CMD:setalltime(playerid,params[]){
new time,str[256],name[MAX_PLAYER_NAME];
if(P_DATA[playerid][alevel] < 2)return SendClientMessage(playerid,-1,"{FFFFFF}You must be{FF0000} Level 2{FFFFFF} to use this command.");
if(sscanf(params,"i",time))return SendClientMessage(playerid,-1,"Usage:/setalltime [Time Value]");
if(time < 0 || time > 24)return SendClientMessage(playerid,-1,"Invalid time value");
for(new p=0; p<MAX_PLAYERS; p++){
if(IsConnect(p)){
SetPlayerTime(p,time,0);
}
}
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),"Admin/mod %s has changed time to %d",name,time);
SendClientMessageToAll(-1,str);
return 1;
}
CMD:setadmin(playerid,params[]){
new id,level,str[256],name[MAX_PLAYER_NAME];
if(P_DATA[playerid][alevel] < 4 && !IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,"{FFFFFF}You must be{FF0000} Level 4{FFFFFF} to use this command!");
if(sscanf(params,"ii",id,level))return SendClientMessage(playerid,0xF6BB0AA,"{FF9900}Usage:{FFFFFF} /setadmin [Playerid] [Level]");
if(!IsConnect(id))return SendClientMessage(playerid,-1,"Player{FF0000} not{FFFFFF} found!");
if(level < 0 || level > 4)return SendClientMessage(playerid,-1,"{FF0000}Invaild{FFFFFF} level!");
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),"{FFFFFF}Administrator{FFFF00} %s{FFFFFF} has changed your level to{FFFF00} %d{FFFFFF}!",name,level);
SendClientMessage(id,-1,str);
P_DATA[id][alevel] = level;
return 1;
}
if(sscanf(params,"ui", id, level))