[Ajuda] comando /ir
#1

Acabei de desenvolver um comando /ir porem quando digito /ir (id_inexistente) aparece Voce teleportou para mim(id)
o admin (eu) teleportou ate voce
e Id invalido
tudo de uma vez
pawn Код:
CMD:ir(playerid,params[])
    {
            new id , str[48];
            new name[32];
            new string[128], aname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,aname, MAX_PLAYER_NAME);
            GetPlayerName(id, pname, MAX_PLAYER_NAME);
            format(str, sizeof(str), "contas/%s.ini", name);
            if(!DOF2_FileExists(str)) DOF2_CreateFile(str); {
            for(new i=0; i<MAX_PLAYERS; i++)

{
            if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "[ERRO] ID invalido");
            if(isnull(params))return SendClientMessage(playerid, -1, "[ERRO] Uso: /ir [playerid]");
            if(pAdmin[i] == 0) return SendClientMessage(playerid,-1,"Voce nao tem permissao para usar este comando");
            if(pAdmin[i] >= 1){
            new Float:x, Float:y, Float:z;
            GetPlayerPos(id, x, y, z);
            SetPlayerPos(playerid, x, y,z);
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
            SetPlayerInterior(playerid, GetPlayerInterior(id));
            format(string, sizeof(string), "{FF0000}(INFO) {FFFFFF}O Admin %s (%d)(») {0000FF}Teleportou ate voce", aname,playerid);
            SendClientMessage(id,-1, string);
            format(string, sizeof(string), "{FF0000}(INFO) {FFFFFF}Voce teleportou ate(») {0000FF} %s (%d)", pname,id);
            SendClientMessage(playerid,-1, string);
            }
            }
            }
            return 1;
        }
Reply


Messages In This Thread
comando /ir - by williamgato - 18.04.2014, 19:15
Re: comando /ir - by Gii - 18.04.2014, 19:22
Re: comando /ir - by williamgato - 18.04.2014, 19:31

Forum Jump:


Users browsing this thread: 2 Guest(s)