SA-MP Forums Archive
Command problem - 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: Command problem (/showthread.php?tid=341904)



Command problem - Zolder - 12.05.2012

pawn Код:
if(strcmp(cmd, "/aod", true) == 0)
    {
        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            if(AdminDuty[playerid] == 1)
            {
                       GetPlayerName(playerid, sendername, sizeof(sendername));
                       format(string, sizeof(string), "[Admin Info]: Administrator %s [ID:%d] is now off duty.", sendername,playerid);
                       SendClientMessageToAll(0xFF5B5BFF,string);
                       AdminDuty[playerid] = 0;
                       SetPlayerHealth(playerid,100);
                       SetPlayerArmour(playerid,0);
                       SetPlayerToTeamColor(playerid);


            }
            else
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "[Admin Info]: Administrator %s [ID:%d] is now on duty.",sendername,playerid);
                SendClientMessageToAll(0xFF5B5BFF,string);
                AdminDuty[playerid] = 1;
                SetPlayerHealth(playerid,5000);
                SetPlayerArmour(playerid,5000);
                SetPlayerColor(playerid,0xFF5B5BFF);
                RepairVehicle(GetPlayerVehicleID(playerid));

                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if(IsPlayerConnected(i))
                    {
                        SetPlayerMarkerForPlayer( i,playerid,0xFF5B5BFF );
                    }
                }
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_GREY,"Your not an admin !");
        }
        return 1;
    }
When type /aod and i'm not moving command work good but when i move or enter in a car "SetPlayerHealth" and "SetPlayerArmour" is set to 100 and "SetPlayerColor(playerid,0xFF5B5BFF)" is set to "SetPlayerToTeamColor(playerid)"

Bad english...sorry.


Re: Command problem - Zolder - 12.05.2012

Solved, thanks.