SA-MP Forums Archive
What is wrong here? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is wrong here? (/showthread.php?tid=94339)



What is wrong here? - _ERO_ - 29.08.2009

I try type command, for when the player is in vehicle, he can destroit it with /vdestroy

but is funcion for vip... i dont know why give this error, the commad is

Код:
dcmd_vdestroy(playerid,params[])
{
 	if(PlayerData[playerid][VIP] == 1)
 	{
  #pragma unused params
	new vipcar;
	IsPlayerInAnyVehicle(playerid);
 	vipcar = GetVehicleModel(vehicleid);
 	DestroyVehicle(vipcar);
 	SendClientMessage(playerid, COLOUR_YELLOW, "Your vehicle is destroy.");
  	return true;
 	}
 	else return false;
}
This is the error.

Код:
C:\Documents and Settings\ERO\Escritorio\Mi Servidor SAMP Pruebas Privadas\Server Pruebas Privado (Hosting)\gamemodes\rtscript.pwn(1575) : error 017: undefined symbol "vehicleid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: What is wrong here? - Correlli - 29.08.2009

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
And IsPlayerInAnyVehicle function should be in the if statement.
And also, you're trying to destroy vehicle-model, you should use vehicleid.


Re: What is wrong here? - SpiderPork - 29.08.2009

pawn Код:
dcmd_vdestroy(playerid,params[])
{
   if(PlayerData[playerid][VIP] == 1)
   {
     if(IsPlayerInAnyVehicle(playerid))
     {
        #pragma unused params
        new vipcar = GetPlayerVehicleID(playerid);
        DestroyVehicle(vipcar);
        SendClientMessage(playerid, COLOUR_YELLOW, "Your VIP vehicle is destroyed.");
        return true;
    }
    else return false;
   }
   else return false;
}



Re: What is wrong here? - ded - 29.08.2009

Quote:
Originally Posted by SpiderPork
pawn Код:
dcmd_vdestroy(playerid,params[])
{
  if(PlayerData[playerid][VIP] == 1)
  {
     if(IsPlayerInAnyVehicle(playerid))
     {
       #pragma unused params
       new vipcar = GetPlayerVehicleID(playerid);
       DestroyVehicle(vipcar);
       SendClientMessage(playerid, COLOUR_YELLOW, "Your VIP vehicle is destroyed.");
       return true;
    }
    else return false;
  }
  else return false;
}
Код:
dcmd_vdestroy(playerid,params[])
{
   if(PlayerData[playerid][VIP] == 1)
   {
     if(IsPlayerInAnyVehicle(playerid))
     {
        #pragma unused params
        new vipcar = GetPlayerVehicleID(playerid);
        DestroyVehicle(vipcar);
        return SendClientMessage(playerid, COLOUR_YELLOW, "Your VIP vehicle is destroyed.");
 	} else return false;
   } else return false;
}
D: