26.05.2013, 10:35
OK, so I have a problem, as an admin(while on foot), I want to be able to teleport a specific vehicle ID to me, using this command:
To see the vehicle's ID, I do /dl ofc, but what happens is that the command will always say "Invalid vehicle ID", no matter what vehicle ID I insert, so, I don't see the problem. Help, please.
pawn Код:
COMMAND:tveh(playerid,params[])
{
if(GetPVarInt(playerid,"Adminlevel")<1) return SendClientMessage(playerid,COLOR_RED,"This command is only for admins");
else
{
new vehicleid;
if(sscanf(params,"u",vehicleid)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/tveh [ID]");
if(!IsValidVehicle(vehicleid)) return SendClientMessage(playerid,COLOR_RED,"Invalid vehicle ID!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetVehiclePos(vehicleid,x+1,y,z);
SendClientMessage(playerid,COLOR_GREEN,"You have succesfully teleported the vehicle to you!");
}
return 1;
}