#1

Код:
public OnPlayerUpdate(playerid)
{
    new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
        if(GetPlayerSpeed(playerid) > 270)
TogglePlayerControllable(playerid,0);
        format(string, sizeof(string), "%s Vaћiavo didesniu nei 270 km/h greičiu. /stebeti %s", name);
if(PlayerInfo[playerid][pAdmin] == 1)
SendClientMessage(playerid, -1, string);
    return 1;
}
This code flood this line:

format(string, sizeof(string), "%s Vaћiavo didesniu nei 270 km/h greičiu. /stebeti %s", name);

When i not going 270 km/h speed.
Reply
#2

I think that happened because is on "public OnPlayerUpdate(playerid)"
Reply
#3

Where i should put it?
Reply
#4

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerSpeed(playerid) > 270)
    {
        TogglePlayerControllable(playerid,0);
        new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s Važiavo didesniu nei 270 km/h greičiu. /stebeti %s", name, name);
        for(new i=0; i<MAX_PLAYERS; i++) if(PlayerInfo[i][pAdmin] == 1) SendClientMessage(i, -1, string);
    }
    return 1;
}
This way it should work.
I suppose you want that admins see the message when a player exceeds the speed. That's why I added the loop, else only the player who exceeds the limit will get the message.
Reply
#5

Thank you, it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)