Question regarding %
#1

You know when you do admin commands like kick etc...

And you get something like this:

"Admin Action: %s has been banned by %s. reason: %s"

I am talking about the highlighted ones, as they are used for GetName playerid or something like that so it sends the message to everyone like

Admin Action: Player1 has been banned by Admin 1. reason:

and I am wondering how do you do it because when I tried to add that similar stuff to my vehicle respawn I get errors:

pawn Код:
(756) : error 017: undefined symbol "str"
(756) : error 017: undefined symbol "str"
(756) : error 029: invalid expression, assumed zero
(756) : fatal error 107: too many error messages on one line
and the code is:

pawn Код:
CMD:respawnveh(playerid, params[])
{
    #pragma unused params
    if(PlayerInfo[playerid][Admin] < 3)
    return SendClientMessage( playerid, COLOR_RED, "[ERROR]:You are not a Public Safety Member! Or your PSM level is too low!" );
    new bool:VehicleUsed[MAX_VEHICLES] = false;
    foreach(Character, i)//for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i)) VehicleUsed[GetPlayerVehicleID(i)] = true;
    }
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if(VehicleUsed[i] == false) SetVehicleToRespawn(i);
        format(str, sizeof(str), "All unccupied vehicles have been respawned by %s ", aName); //newly added
    }
}
Could anyone explain to me how it is done?

Thank you if you are looking into the topic!
Reply


Messages In This Thread
Question regarding % - by Tachibana - 24.06.2011, 00:00
Re: Question regarding % - by Donya - 24.06.2011, 00:08
Re: Question regarding % - by Tachibana - 24.06.2011, 00:12
Re: Question regarding % - by StreetGT - 24.06.2011, 00:16
Re: Question regarding % - by Tachibana - 24.06.2011, 00:21

Forum Jump:


Users browsing this thread: 2 Guest(s)