06.04.2011, 15:03
Hello, I have a problem with this.
Can anyone show how to make a code where you cant goto a vehicle which doesnt exists?
pawn Код:
COMMAND:vgoto(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >=1) {
new vid;
if(sscanf(params, "d", vid)) return SendClientMessage(playerid, Yellow, "Usage: /gotov <vehicleid>");
new Float:x, Float:y, Float:z, vw;
GetVehiclePos(vid,x,y,z);
vw = GetVehicleVirtualWorld(vid);
SetPlayerVirtualWorld(playerid,vw);
if(GetPlayerState(playerid) == 2)
{
new pvid = GetPlayerVehicleID(playerid);
SetVehiclePos(pvid,x,y,z);
SetVehicleVirtualWorld(pvid,vw);
}
else SetPlayerPos(playerid,x,y,z+1);
} else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
return 1;
}