28.06.2014, 22:33
Hello, Why When i type this command and spamming me its messages a lot?
Code:
Code:
pawn Код:
COMMAND:getall(playerid, params[])
{
new string[128], adminname[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFF0000AA, "You Are Not A Master Moderator Or Higher Rank!");
foreach(Player, i)
{
i =! playerid;
if(!IsPlayerConnected(i) || i == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "No One Is Connected To Be Teleported!");
GetPlayerName(playerid, adminname, MAX_PLAYER_NAME);
if(PlayerInfo[playerid][pAdmin] > 0)
{
switch(PlayerInfo[playerid][pAdmin])
{
case 1: AdmRank = "Trial Moderator";
case 2: AdmRank = "Moderator";
case 3: AdmRank = "Master Moderator";
case 4: AdmRank = "Trial Administrator";
case 5: AdmRank = "Administrator";
case 6: AdmRank = "Master Administrator";
case 7: AdmRank = "Head Administrator";
case 8: AdmRank = "Trusted Administrator";
case 9: AdmRank = "Co-Owner";
case 10: AdmRank = "Owner";
}
format(string, sizeof(string), "The {FF0000}%s {FFA600}%s (%d) {00FF1E}Has Teleported All Players To His Position.",AdmRank, adminname, playerid);
SendClientMessage(i, 0x00FF1EFF, string);
SendClientMessage(playerid,0xFFEA00AA,"You Have Successfully Teleported All Players To Your Position.");
SetPlayerInterior(i,GetPlayerInterior(playerid));
new Float:TPX, Float:TPY, Float:TPZ;
GetPlayerPos(playerid, TPX, TPY, TPZ);
SetPlayerPos(i, TPX, TPY+1, TPZ);
if(IsPlayerInAnyVehicle(i)) SetVehiclePos(GetPlayerVehicleID(i), TPX+2,TPY+2,TPZ) , PutPlayerInVehicle(i, GetPlayerVehicleID(i), 0);
}
if(PlayerInfo[i][pAdmin] > 0)
{
i = playerid;
format(string, sizeof(string), "[ADM] The {FF0000}%s {FF5900}%s (%d) Has Teleported All Players To His Position.",AdmRank, adminname, playerid), SendClientMessage(i, 0xFF5900FF, string);
print(string);
}
}
return 1;
}