CMD refusing to work
#1

pawn Код:
if(strcmp(cmd, "/recovercar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /recovercar [VehID]");
        new vehicleid = strval(tmp);

        if(PlayerInfo[playerid][pAdmin] >= 5)
        {
            SetVehicleToRespawn(vehicleid);
            SetVehicleVirtualWorld(vehicleid, 0);
            SendClientMessage(playerid, COLOR_GREY, "* Vehicle respawned, in VirtualWorld 0.");
        }
        return 1;
    }
Someone correct me, why does that not make the car re-spawn, back as its known position, in VW0?
Reply
#2

Quote:

[pawm]

edit it please ! easier to read
Reply
#3

Quote:
Originally Posted by vernz
Посмотреть сообщение
edit it please ! easier to read
Whooooops
Reply
#4

pawn Код:
if(strcmp(cmd, "/recovercar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /recovercar [VehID]");
        new vehicleid = strval(tmp);

        if(PlayerInfo[playerid][pAdmin] >= 5)
        {
            SetVehicleToRespawn(vehicleid);
            SetVehicleVirtualWorld(vehicleid, 0);
            SendClientMessage(playerid, COLOR_GREY, "* Vehicle respawned, in VirtualWorld 0.");
            OnPropUpdate(4,vehicleid);
            OnPlayerUpdateEx(playerid);
        }
        return 1;
    }
pawn Код:
if(strcmp(cmd, "/gotocar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /gotocar [carid]");
                return 1;
            }
            new testcar = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                new vehworld = GetVehicleVirtualWorld(testcar);
                if (vehworld == 63 || 65) return SendClientMessage(playerid, COLOR_GREY, "Error! This vehicle is not spawned by it's owner.");
               
                new Float:cwx2,Float:cwy2,Float:cwz2;
                GetVehiclePos(testcar, cwx2, cwy2, cwz2);
                if (GetPlayerState(playerid) == 2)
                {
                    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
                    SafeRemovePlayerFromVehicle(playerid);
                    SafeSetPlayerPos(playerid, cwx2,cwy2,cwz2+2);
                }
                else
                {
                    SafeSetPlayerInterior(playerid,0);
                    SafeSetPlayerPos(playerid, cwx2,cwy2,cwz2+2);
                }
                SendClientMessage(playerid, COLOR_ORANGE, "** You have been teleported");
                OnPlayerExitFood(playerid);
                format(string, sizeof(string), "[ADMIN]: %s Has Teleported Himself To Car: [%d].", sendername, testcar);
                ABroadCast(COLOR_LIGHTRED,string, 5);
                DisablePlayerCheckpoint(playerid);
                new y, m, d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Teleported Himself to Car Id: [%d]",d,m,y,h,mi,s,sendername,testcar);
                TelesLog(string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "** You are not authorized to use that command!");
                return 1;
            }
        }
        return 1;
    }
Can someone explain why I always get the error, car isnt spawned by the owner? -- That should work rite?
Reply
#5

Should be if(vehworld == 63 || vehworld == 65)
Reply
#6

Quote:
Originally Posted by you10
Посмотреть сообщение
Should be if(vehworld == 63 || vehworld == 65)
Thankyou! +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)