public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == vehicleidfordonors) // Change 'vehicleidfordonors' to your vehicle id.
{
if(!PlayerInfo[playerid][pDonator]) // Check if the player is not a donor.
{
return 0; // Not letting him get into the car.
}
}
return 1;
}
//Under ongamemodeinit
new vehicleidfordonors = CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60); //example car from wiki, you'll have to change it
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == vehicleidfordonors) // Change 'vehicleidfordonors' to your vehicle id.
{
if(PlayerInfo[playerid][pDonator]) // Check if the player is not a donor.
{
SendClientMessage(playerid, -1, "You've got in a VIP car!"); // -1 Is white color
}
}
else SendClientMessage(playerid, -1, "You're not vip silly.."); //The message the player will get if they're no vip
return 1;
}
Actually, the code you posted still lets him get into the car. You need to return false.
|
RemovePlayerFromVehicle(playerid);
//Under ongamemodeinit
new vehicleidfordonors = CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60); //example car from wiki, you'll have to change it
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == vehicleidfordonors) // Change 'vehicleidfordonors' to your vehicle id.
{
if(PlayerInfo[playerid][pDonator]) // Check if the player is not a donor.
{
SendClientMessage(playerid, -1, "You've got in a VIP car!"); // -1 Is white color
}
}
else SendClientMessage(playerid, -1, "You're not vip silly.."); //The message the player will get if they're no vip
return 1;
}
{
if(vehicleid == 451) // Change 'vehicleidfordonors' to your vehicle id.
{
if(PlayerInfo[playerid][pDonator] > 0) // Check if the player is not a donor.
{
SendClientMessage(playerid, -1, "You've got in a VIP car!"); // -1 Is white color
}
}
else SendClientMessage(playerid, -1, "You're not vip silly.."); //The message the player will get if they're no vip
RemovePlayerFromVehicle(playerid);
return 1;
}
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(41226) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(41218) : warning 204: symbol is assigned a value that is never used: "vehicleidfordonors"
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46747) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46766) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46950) : warning 217: loose indentation
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46971) : error 017: undefined symbol "vehicleid"
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46984) : warning 225: unreachable code
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46984) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\Horizon\gamemodes\HRP_9.01.pwn(46971) : error 017: undefined symbol "vehicleid"