CMD help
#1

Ok so i wanna get the teleports from one stunt gm to another and its easier for me to just copy paste them than remake them using strcmp


they are like this
pawn Code:
CMD:race(playerid, params[])
        {
        SetTimerEx("Loaded", 3000, 0, "d", playerid);
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
        {
        GameTextForPlayer(playerid,"~r~Bun ~b~Venit!",4000,6);
        return SetVehiclePos(vehicleid,-154.4948,-187.6738,1.9254);
        }
        SetPlayerPos(playerid,-154.4948,-187.6738,1.9254);
        GameTextForPlayer(playerid,"~r~Bun ~b~Venit!",4000,6);
        return 1;
        }

I got everything in order so the filterscript doesnt give errors (cause if i put it in my gamemode ,some commands just say unknown command ,it bugs my gm ) .


The weird thing is ,those cmd are NOT into the public onplayercommand text ,they are in NO public ,though in the public there is a
pawn Code:
new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);

I have no idea how to make them work without remaking them using the default strcmp

any idea pls ? the filterscript loads but the teleports just dont work ,they dont show errors ,but dont teleport me either
Reply
#2

There is a thread about converting them from strcmp to zcmd - if that is what you mean
Reply
#3

i dont need a tutorial ,i know how to make them into strcmp ,they are just teleports ,what i say its that they aint working like this and being A LOT OF TELEPORTS would be easier to repair them than make 100 teleport commands based off these ones...
Reply
#4

lol read about strcmp and zcmd which a big different. I dont know why people put randomly codes from a GM to another without knowing what they're doing...bah
Reply
#5

So what's the problem? I really dont understand correctly.

Explain more better and what you need.

Thanks!

Edit:

Try this:

pawn Code:
CMD:race(playerid, params[])
{
    SetTimerEx("Loaded", 3000, 0, "d", playerid);
    new vehicleid = GetPlayerVehicleID(playerid);
    new State = GetPlayerState(playerid);
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            GameTextForPlayer(playerid,"~r~Bun ~b~Venit!",4000,6);
            SetVehiclePos(vehicleid,-154.4948,-187.6738,1.9254);
        }
    }
        else
        {
            SetPlayerPos(playerid,-154.4948,-187.6738,1.9254);
            GameTextForPlayer(playerid,"~r~Bun ~b~Venit!",4000,6);
        }
    return 1;
}
Not tested.
Reply
#6

nvm i got it fixed ,everything was fine excepting the fact that i included sscanf2 and not sscanf (dont ask)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)