[HELP] spam text
#1

Hello. Sometimes when I sit on car I get spammed by text you don't have a driver license? Be careful and watch out for police and it's just spamming and player most exit from server and then enter again. This code is under Onplayerstatechange


pawn Код:
if(!IsAPlane(GetVehicleModel(GetPlayerVehicleID(playerid))) && !IsABoat(GetVehicleModel(GetPlayerVehicleID(playerid))) && !VoziloJeBiciklo(GetVehicleModel(GetPlayerVehicleID(playerid))))
        {
            if(PlayerInfo[playerid][DriverLicense] == 0) SendClientMessage(playerid,COLOR_LIGHTRED,"You don't have a driver license? Be careful and watch out for police!");
            Speedo(playerid,1);
            new string[128];
            format(string,sizeof string,"%.1fl",Fuel[GetPlayerVehicleID(playerid)]);
            TextDrawSetString(Speedometar0[playerid],string);
        }
Reply
#2

pawn Код:
if(!IsAPlane(GetVehicleModel(GetPlayerVehicleID(playerid))) && !IsABoat(GetVehicleModel(GetPlayerVehicleID(playerid))) && !VoziloJeBiciklo(GetVehicleModel(GetPlayerVehicleID(playerid))))
        {
            if(PlayerInfo[playerid][DriverLicense] == 1) SendClientMessage(playerid,COLOR_LIGHTRED,"You don't have a driver license? Be careful and watch out for police!");
            Speedo(playerid,1);
            new string[128];
            format(string,sizeof string,"%.1fl",Fuel[GetPlayerVehicleID(playerid)]);
            TextDrawSetString(Speedometar0[playerid],string);
        }
Reply
#3

First of all

Make something that checks if player has license

So if he has it says idk you choose if he doesn't have it says You don't got bla bla bla.. just return Senclientmessege etc..

Anyways try this not sure..
PHP код:
if(!IsAPlane(GetVehicleModel(GetPlayerVehicleID(playerid))) && !IsABoat(GetVehicleModel(GetPlayerVehicleID(playerid))) && !VoziloJeBiciklo(GetVehicleModel(GetPlayerVehicleID(playerid))))
        {
            if(
PlayerInfo[playerid][DriverLicense] == 1SendClientMessage(playerid,COLOR_LIGHTRED,"You don't have a driver license? Be careful and watch out for police!");
            
Speedo(playerid,1);
            new 
string[128];
            
format(string,sizeof string,"%.1fl",Fuel[GetPlayerVehicleID(playerid)]);
            
TextDrawSetString(Speedometar0[playerid],string);
            return 
1;

Reply
#4

The problem isn't in the code posted above, despite the two replies you've had, the problem is located before it.

If you want help, please post the full code / function. This should be under OnPlayerEnterVehicle, without a loop. Unless your SAMP is bugged, it would be a problem with you having a loop or having this under OnPlayerUpdate (Like alot of other servers).
Reply
#5

This is full code there's nothung more I post everything and the place where it is and it is under onplayerstatechange. That's it. Thanks
Reply
#6

You tested my code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)