/call hydra
#1

Hey guys currently i have a command called /call hydra that when used it will CreateVehicle and place you inside it. But i'm struggling to work out how to stop it respawning....

E.g. if a player /call hydra and for example crashes into a building that vehicle is gone and will not reappear on the Carrier.

Here is the command code at the moment.

pawn Код:
if(strcmp(cmdtext, "/call hydra", true) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, 2728.0461,-2302.7786,16.5892))
    {
    GetPlayerPos(playerid,X,Y,Z);
    PutPlayerInVehicle(playerid, CreateVehicle(520,X,Y,Z,0,-1,-1,-1),0);
    return 1;
    }
}
Reply
#2

Try adding a AddStaticVehicleEx (520, X, Y, Z, 0, 0, 0, 900)
Reply
#3

Will Do.

I will post back the results
Reply
#4

Nope.. That didn't work either.

pawn Код:
if(strcmp(cmdtext, "/call hydra", true) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7, 2728.0461,-2302.7786,16.5892))
    {
    GetPlayerPos(playerid,X,Y,Z);
    PutPlayerInVehicle(playerid, AddStaticVehicleEx (520, X, Y, Z, 0, 0, 0, 900);
    return 1;
    }
}
Heres the updated code. Unless you mean... AddStaticVehicle and then call the vehicles ID to the spot..
Reply
#5

pawn Код:
if(strcmp(cmdtext, "/callhydra", true) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 7, 2728.0461,-2302.7786,16.5892))
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        new hydra = AddStaticVehicleEx(520, x, y, z, 0, 1, 1, 240);
        PutPlayerInVehicle(playerid, hydra, 0);
        return 1;
    }
}
Note: I used "/callhydra" not "/call hydra".
Reply
#6

If you want to use spaces ( /call hydra ) I think you MUST use:
pawn Код:
if(strcmp(cmdtext, "/call", true) == 0)
{
    if( !strcmp( cmdtext[ 6 ], "hydra", true, 5 ) )
    {
        if(IsPlayerInRangeOfPoint(playerid, 7, 2728.0461,-2302.7786,16.5892))
        {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid, x, y, z);
            new hydra = AddStaticVehicleEx(520, x, y, z, 0, 1, 1, 240);
            return PutPlayerInVehicle(playerid, hydra, 0);
        }
    }
    else return SendClientMessage( playerid, 0xAAAAAA, "USAGE: /call hydra" );
}
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)