/up command
#10

pawn Код:
if(strcmp(cmd, "/up", true) == 0){
          if(IsPlayerAdmin(playerid){
                new tmp[128],height;
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))return SendClientMessage(playerid, color, "USE: /up [playerid] [height]");
                giveplayerid = strval(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))return SendClientMessage(playerid, color, "USE: /up [playerid] [height]");
                height = strval(tmp);
                if(!IsPlayerConnected(giveplayerid))return SendClientMessage(playerid, color,"Bad Playerid");
                new Float:x,Float:y,Float:z;
                GetPlayerPos(giveplayerid,x,y,z);
                SetPlayerPos(giveplayerid,x,y,z+height);
            }else{
              SendClientMessage(playerid, color,"ERROR: ADMIN_ACCESS_REQUIERED");
            }
            return 1;
        }
this should help u.. if u cannot edit it for u'r need then sry man i'm not gonna help total n00bs.(if u got it and u have problems.. cuz this is untested .. then just ask me for help i look what I'd wrong.)

here u have a more "advanced" and tested one:
pawn Код:
if(strcmp(cmd, "/upingp", true)==0 && IsPlayerAdmin(playerid)) {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, color, "USE: /upingp [playerid] [height 1 - 20000]");
        }else{
            if(!IsPlayerConnected(strval(tmp))) {
                SendClientMessage(playerid, color, "Bad Playerid");
            } else {
                new newz;
                static Float:X;
                static Float:Y;
                static Float:Z;
                new VehicleID;
                tmp2 = strtok(cmdtext, idx);
                newz = strval(tmp2);
                if(!newz) {
                    SendClientMessage(playerid, color, "USE: /upingp [playerid] [height 1 - 20000]");
                    return 1;
                }
                if(newz >20000 || newz <1) {
                    SendClientMessage(playerid, color, "USE: /upingp [playerid] [height 1 - 20000]");
                }else {
                    if(IsPlayerInAnyVehicle(strval(tmp))) {
                        SetPlayerInterior(strval(tmp), 0);
                        GetPlayerPos(strval(tmp), X, Y, Z);
                        new inte;
                        inte = GetPlayerInterior(strval(tmp));
                        SetPlayerInterior(strval(tmp), inte);
                        VehicleID = GetPlayerVehicleID(strval(tmp));
                        SetVehiclePos(VehicleID,X,Y, Z+newz);
                    } else {
                        new inte;
                        inte = GetPlayerInterior(strval(tmp));
                        SetPlayerInterior(strval(tmp), inte);
                        GetPlayerPos(strval(tmp),X, Y,Z);
                        SetPlayerPos(strval(tmp),X,Y,Z+newz);
                    }
                }
            }
        }
        return 1;
    }
Reply


Messages In This Thread
/up command - by Butilka - 18.08.2009, 21:09
Re: /up command - by silvan - 18.08.2009, 22:42
Re: /up command - by Butilka - 19.08.2009, 08:06
Re: /up command - by MenaceX^ - 19.08.2009, 08:12
Re: /up command - by Butilka - 19.08.2009, 08:14
Re: /up command - by MenaceX^ - 19.08.2009, 08:28
Re: /up command - by Butilka - 19.08.2009, 08:30
Re: /up command - by MenaceX^ - 19.08.2009, 08:35
Re: /up command - by Butilka - 19.08.2009, 09:35
Re: /up command - by Gamer_Z - 19.08.2009, 10:22

Forum Jump:


Users browsing this thread: 1 Guest(s)