prints message too many times and then gives unknown command
#1

PHP код:
COMMAND:rac(playeridparams[])
{
    new 
string[128],sendername[MAX_PLAYER_NAME];
    if (
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_WHITE"You must be logged in to use this.");
    if(
GetPVarInt(playerid"Admin") >= 3)
    {
           for(new 
1<= MAX_VEHICLESv++)
        {
            new 
bool:despawn true;
            foreach(new 
Player)
             {
                 if(
IsPlayerInAnyVehicle(i) && GetPlayerVehicleID(i) == v)
                 {
                     
despawn false;
                 }
             }
            if(
despawn == true)
            {
                
DespawnVehicle(v);
            }
            
format(sendernamesizeof(sendername), "%s"PlayerInfo[playerid][pUsername]);
              
GiveNameSpace(sendername);
            
format(stringsizeof(string), "Server Action: All unoccupied vehicles has been despawned by Administrator %s (%s)."sendernameAdminName(playerid));
              
SendClientMessageToAllEx(COLOR_REDstring);
        }
    }
    else 
SendClientMessage(playeridCOLOR_ERROR"You do not have access to this command!");
    return 
1;

This is the line that does the issues -

PHP код:
format(stringsizeof(string), "Server Action: All unoccupied vehicles has been despawned by Administrator %s (%s)."sendernameAdminName(playerid)); 
It's printing it to all, but eventually it prints like 100 lines of it. and then says it's an unknown command.. ? what am I done wrong?
Reply
#2

Because it's inside the loop,maybe.Try to move them
Reply
#3

Quote:
Originally Posted by Dice_
Посмотреть сообщение
Because it's inside the loop,maybe.Try to move them
Oh fuck, sorry didn't saw the loop the time does itself lol thanks for making me notice!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)