Why it doesn't work?
#1

Код:
COMMAND:veh(playerid, params[])
{
	new car;
	new Float:x;
	new Float:y;
	new Float:z;
    if(sscanf(params, "i", car))
    {
         SendClientMessage(playerid, 0xFF0000FF, "Usage: /veh <id>");
}

        GetPlayerPos(playerid,x,y,z);
		CreateVehicle(car, x+2, y, z, 82.2873, 0, 1,60);
		PutPlayerInVehicle(playerid, car, 0);
		
	
			return 1;
}
What is the problem with this script? When I write for example "/veh 420" I am just teleporting in a random vehicle. But I want to check player position, then create car in this position and put the player in it. I know that I need to check vehicle id > 400 and vehicle id < 611, but it does not matter for now.
Reply
#2

if(sscanf(params, "i", car))

Why not try with
if(sscanf(params, "d, car))
Reply
#3

pawn Код:
COMMAND:veh(playerid, params[])
{
    new car;
    new Float:x;
    new Float:y;
    new Float:z;
    if(sscanf(params, "i", car))
    {
         SendClientMessage(playerid, 0xFF0000FF, "Usage: /veh <id>");
}

        GetPlayerPos(playerid,x,y,z);
    new tmp_car =   CreateVehicle(car, x+2, y, z, 82.2873, 0, 1,60);
        PutPlayerInVehicle(playerid, tmp_car, 0);
       
   
            return 1;
}
Reply
#4

Thanks, Norck! It works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)