10.01.2011, 19:12
hi,
i just wrote down some code lines that shall prevent the use of vehicles to all players with a score lower than 50.
But its bugged up
Well for me it works but if therre are more players online it just doesnt work. The ClientMessage is always displayed right but the ejection system does not work correctly.
regards...
i just wrote down some code lines that shall prevent the use of vehicles to all players with a score lower than 50.
But its bugged up
Well for me it works but if therre are more players online it just doesnt work. The ClientMessage is always displayed right but the ejection system does not work correctly.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new ValidScore;
ValidScore = GetPlayerScore(playerid);
if(ValidScore > 50)
{
SendClientMessage(playerid,0xAA3333AA,"{76EEC6}Drive {283A90}carefully.");
}
else
{
SetTimer("CarEjecter",1000,10);
SendClientMessage(playerid,0xAA3333AA,"{76EEC6}Your Score {551011}is not high enough to drive this {76EEC6}vehicle!");
}
return 1;
}
forward CarEjecter(playerid);
public CarEjecter (playerid)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
{
RemovePlayerFromVehicle(playerid);
}
}