SA-MP Forums Archive
prints message too many times and then gives unknown command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: prints message too many times and then gives unknown command (/showthread.php?tid=635639)



prints message too many times and then gives unknown command - DemME - 11.06.2017

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?


Re: prints message too many times and then gives unknown command - Fairuz - 11.06.2017

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


Re: prints message too many times and then gives unknown command - DemME - 11.06.2017

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!