SA-MP Forums Archive
CMD help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CMD help (/showthread.php?tid=278674)



CMD help - rekatluos - 23.08.2011

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


Re: CMD help - Pinguinn - 23.08.2011

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


Re: CMD help - rekatluos - 23.08.2011

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...


Re: CMD help - TheArcher - 23.08.2011

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


Re: CMD help - Davz*|*Criss - 23.08.2011

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.


Re: CMD help - rekatluos - 23.08.2011

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