[Ajuda] Esta certo esse Cуdigo?
#1

Код:
    if(strcmp(cmd, "/ircord", true) == 0)
    {
	    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Somente administrador rcon pode usar!");
	    new Float:P[3], aStr[75];
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
	    P[0] = strval(tmp);
	    if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
	    P[1] = strval(tmp);
	    if(!strlen(tmp)) return SendClientMessage(playerid, -1 , "/ircord [x] [y] [z]");
	    P[2] = strval(tmp);
	    SetPlayerPos(playerid, P[0], P[1], P[2]);
	    format(aStr, sizeof(aStr), "Teleportado atй as cordenadas X » [%f] , Y » [%f] , Z » [%f]", P[0], P[1], P[2]);
	    return 1;
    }
e pq sempre que uso meu char aparece la no cйu caindo!
Reply
#2

uma vez eu fiz desse jeito e bugo...
tenta assim ^^
pawn Код:
if(strcmp(cmd, "/ircord", true) == 0)
    {
        new y[256];
        new z[256];
        new inte[256];
        new world[256];
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /ircord [x] [y] [z] [Interior] [virtual world]");
                return 1;
            }
            y = strtok(cmdtext, idx);
            if(!strlen(y))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /ircord [x] [y] [z] [Interior] [virtual world]");
                return 1;
            }
            z = strtok(cmdtext, idx);
            if(!strlen(z))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /ircord [x] [y] [z] [Interior] [virtual world]");
                return 1;
            }
            inte = strtok(cmdtext, idx);
            if(!strlen(inte))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /ircord [x] [y] [z] [Interior] [virtual world]");
                return 1;
            }
            world = strtok(cmdtext, idx);
            if(!strlen(world))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USE: /ircord [x] [y] [z] [Interior] [virtual world]");
                return 1;
            }
            new x3 = strval(tmp);
            new y3 = strval(y);
            new z3 = strval(z);
            new interior2 = strval(inte);
            new world2 = strval(world);
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                new Float:x2,Float:y2,Float:z2;
                x2 = x3;
                y2 = y3;
                z2 = z3;
                SetPlayerPos(playerid, x2, y2, z2);
                SendClientMessage(playerid, COLOR_GRAD1, "Voce foi teleportado pelo Admin!");
                SetPlayerInterior(playerid, interior2);
                SetPlayerVirtualWorld(playerid,world2);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Voce nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
eu uso esse comando e funciona perfeitamente ^^
Reply
#3

como uso esse comando?

tipo nгo e interior ae:

1574.2351 -2207.5906 13.5547 0 1 se nгo houver interior

1574.2351 -2207.5906 13.5547 1 0 se houver interior

assim o modo de usar? parece que sim.

+resp
Reply
#4

pawn Код:
(PlayerInfo[playerid][pAdmin] >= 4) troque por  if(IsPlayerAdmin(playerid)){
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)