Announce Cmd
#1

I Use a PPC Admin System Here is 1 Cmd From PPC:
// Repairs all vehicles
COMMAND:repairall(playerid, params[])
{
// Send the command to all admins so they can see it
SendAdminText(playerid, "/repairall", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 3
if (APlayerData[playerid][PlayerLevel] >= 3)
{
// Loop through all vehicles
for (new i; i < 2000; i++)
RepairVehicle(i); // Fully repair the vehicle (damage value and bodywork)

// Send all players a message to inform them that all vehicles have been repaired
SendClientMessageToAll(0x00FF00FF, "All vehicles have been successfully repaired!");
}
else
return 0;
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}
To use The Announce Cmd I U have It Be level 1 Any Help?
Reply
#2

pawn Код:
CMD:announce(playerid,params[])
{
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if(insull(params)) return SendClientMessage(playerid,-1,"/announce text");
GameTextForAll(params,5000,3);
}
}
return 1;
}
Reply
#3

i got Error
pawn Код:
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5095) : error 017: undefined symbol "insull"
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(943) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(1108) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(3528) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(3543) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(3948) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.;
Reply
#4

Quote:
Originally Posted by Geeboi_Mehdi
Посмотреть сообщение
i got Error
pawn Код:
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5095) : error 017: undefined symbol "insull"
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(943) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(1108) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(3528) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(3543) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(3948) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.;
Here you have the "fixed" version.Only a small typo.
pawn Код:
CMD:announce(playerid,params[])
{
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if(isnull(params)) return SendClientMessage(playerid,-1,"/announce text");
GameTextForAll(params,5000,3);
}
}
return 1;
}
Reply
#5

pawn Код:
#include zcmd
#include sscanf2
CMD:announce(playerid,params[])
{
    new str[256];
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 1)
        {
            if(sscanf(params, "s", str)) return SendClientMessage(playerid, -1, "Usage: /announce [Announce Msg]");
            format(str, sizeof(str), "%s", str);
            GameTextForAll(str, 5000, 3);
        }
        else return SendClientMessage(playerid, -1, "you need to be an admin to use this commands!");
    }
    else return SendClientMessage(playerid, -1, "You need to be logged in to use this commands.");
    return 1;
}
Reply
#6

Thank u U are Reped
Reply
#7

works ?

the comments update.

pawn Код:
GameTextForAll(string, 5000, 3);
to
pawn Код:
GameTextForAll(str, 5000, 3);
string to str.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)