Setting a 3 limit counter then kicking the player...
#3

Quote:
Originally Posted by Kasichok
Посмотреть сообщение
PHP код:
new warnings[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
warnings[playerid] = 0;
    return 
1;
}
//OnPlayerStateChange
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 425 && User[playerid][accountVIP] == 0)
{
    
warnings[playerid] ++;
    if(
warnings[playerid] > 2Kick(playerid);
    
RemovePlayerFromVehicle(playerid);
    
SendClientMessage(playerid, -1"Hunter can only be used by VIP players.");

Just tried, this is what i want but it doesn't seem to work, as soon as i try to enter hunter the function with loop giving instantly 3 warnings resulting in a kick.

Also how can i make it to SendClientMessage everytime the said players gets a warning, ex:
"Hunter can only be used by VIP Players, Warning 1/3"

I'm sorry my syntax is really bad...



Edit:Fixed the loop, had to add return 1... I only need to get the SendClientMessage to properly display warnings before kicking the player. Also not sure if this has to do anything with "OnPlayerStateChange" but when i enter and leave vehicles the game will freeze for a second or two.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)