Can't get this to work for the life of me
#6

Quote:
Originally Posted by Bingo
Посмотреть сообщение
You are not getting the vehicle's ID dude you just defined it.

Look at /uselock you'll see on top new id= and so on.
And what about sscanf?

Like cmd gives the vehicle's id. /towcar [VEHICLEID],
so, command works with id that's given.

And you probably right.

-------

Probably cmd won't work, because you have static vehicles too, like police n shit, well, I guess when you enter car's id, you entered the id of mysql cars list.

Try:
PHP код:
CMD:towcar(playeridparams[])
{
    new 
vehicleid;
    if (
sscanf(params"d"vehicleid))
        return 
SendSyntaxMessage(playerid"/towcar [veh]");
        
    if (
vehicleid || vehicleid MAX_VEHICLES || !IsValidVehicle(vehicleid))
        return 
SendErrorMessage(playerid"You have specified an invalid vehicle ID.");
    
id Car_GetID(vehicleid);
        
    if (
Car_IsOwner(playeridid)) {
        
RespawnVehicle(id);
        
Car_Save(id);
        
SendServerMessage(playerid"You have respawned vehicle ID: %d."id);
        
GiveMoney(playerid, -500);
    } else {
        
SendErrorMessage(playerid"You cannot respawn a car that you do not own."); 
    }
    return 
1;

Reply


Messages In This Thread
Can't get this to work for the life of me - by Luke_James - 22.08.2015, 18:22
Re: Can't get this to work for the life of me - by thaKing - 22.08.2015, 18:28
Re: Can't get this to work for the life of me - by Luke_James - 22.08.2015, 18:32
Re: Can't get this to work for the life of me - by thaKing - 22.08.2015, 18:50
Re: Can't get this to work for the life of me - by Bingo - 22.08.2015, 18:56
Re: Can't get this to work for the life of me - by thaKing - 22.08.2015, 19:04
Re: Can't get this to work for the life of me - by Luke_James - 22.08.2015, 19:51
Re: Can't get this to work for the life of me - by Luke_James - 22.08.2015, 19:53

Forum Jump:


Users browsing this thread: 2 Guest(s)