public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { if(!GetPlayerSkin == theskinidyouwant) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You can't drive this vehicle."); } } }
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vid //Fill in the vehicle id
{
if(GetPlayerSkin(playerid) != skin) //Fill in the skin
{
RemovPlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF, "you cant drive this");
}
}
return 1;
}
pawn Code:
|
C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(207) : error 029: invalid expression, assumed zero
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vid) //Fill in the vehicle id
{
if(GetPlayerSkin(playerid) != skin) //Fill in the skin
{
RemovPlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF, "you cant drive this");
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vid) //Fill in the vehicle id
{
if(GetPlayerSkin(playerid) != skin) //Fill in the skin
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF, "you cant drive this");
}
}
return 1;
}
pawn Code:
|
Did you replace the 'vid' in if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vid) with that vehicle ID?
|
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { if(GetPlayerSkin(playerid) == skin %% GetVehicleModel(GetPlayerVehicleID(playerid)) == car)// replace skin with the skin id you want, replace car with the carmodel id you want. { SendClientMessage(playerid, color, "Welcome to your car!"); // Replace color with the color you want } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, color, "You are not allowed to drive this car!"); //replace color with the color you want } } return 1; }
Code:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { if(GetPlayerSkin(playerid) == skin %% GetVehicleModel(GetPlayerVehicleID(playerid)) == car)// replace skin with the skin id you want, replace car with the carmodel id you want. { SendClientMessage(playerid, color, "Welcome to your car!"); // Replace color with the color you want } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, color, "You are not allowed to drive this car!"); //replace color with the color you want } } return 1; } |
C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : error 029: invalid expression, assumed zero C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : warning 215: expression has no effect C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : error 001: expected token: ";", but found ")" C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : error 029: invalid expression, assumed zero C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
error:
Code:
C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : error 029: invalid expression, assumed zero C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : warning 215: expression has no effect C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : error 001: expected token: ";", but found ")" C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : error 029: invalid expression, assumed zero C:\Users\Root\Desktop\Serveris\gamemodes\Untitled.pwn(214) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
Did you copied properly? Because when I compile, it totally works. Did you replace the skin etc, like i said in the comments?
|
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
if(GetPlayerSkin(playerid) == skin && GetVehicleModel(GetPlayerVehicleID(playerid)) == car)// replace skin with the skin id you want, replace car with the carmodel id you want.
{
SendClientMessage(playerid, color, "Welcome to your car!"); // Replace color with the color you want
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, color, "You are not allowed to drive this car!"); //replace color with the color you want
}
}
return 1;
}
//Put This At The Top
new vtest;
//Put vtest = CreateVehicle(520, 1946.0304, -2346.7761, 14.5325, 0.0000, -1, -1, 100);
//public OnGameModeInit()
//{
// Don't use these lines if it's a filterscript
// SetGameModeText("Blank Script");
// vtest = CreateVehicle(520, 1946.0304, -2346.7761, 14.5325, 0.0000, -1, -1, 100);
// return 1;
//}
//This is the hydra it will spawn at LS airport just past the main entrance
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vtest //Fill in the vehicle id
{
if(GetPlayerSkin(playerid) != 26) //Fill in the skin
{
RemovPlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF, "you cant drive this");
}
}
return 1;
}
Do This
pawn Code:
|