hey guys i want to replace Admin %s give you leader Faction 1 to Admin %s give you leader LSPD example or Ballas GSF
Код:
CMD:makeleader(playerid,params[])
{
new string[128], igrac, giveplayerid, giveplayer[MAX_PLAYER_NAME], level, sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerAdmin(playerid))
{
if(!sscanf(params, "ui", giveplayerid, level))
{
PlayerInfo[igrac][pRank] = 6;
PlayerInfo[igrac][pMember] = 0;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"Pogresan igracev id");
PlayerInfo[giveplayerid][pLeader] = level;
format(string, sizeof(string), "Dao si igracu %s lidera organizacije %i", giveplayer, level);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "Admin %s ti je dao lidera organizacije %i", sendername, level);
SendClientMessage(giveplayerid, -1, string);
if(level == 0) { PlayerInfo[giveplayerid][pSkin] = 0; PlayerInfo[giveplayerid][pRank] = 0; return 1; }
else if(level == 1) { PlayerInfo[giveplayerid][pSkin] = 288; } //Policija
SetPlayerSkin(giveplayerid,PlayerInfo[giveplayerid][pSkin]);
}
else SendClientMessage(playerid, -1,"Koristenje /makeleader [IDigraca/Dio imena] [broj(1-2)]");
}
else SendClientMessage(playerid, -1,"Niste ovlasteni da koristite ovu komandu");
return 1;
}
Код:
new str[10];
if(!sscanf(params, "ui", giveplayerid, level))
{
switch(level)
{
case 1: str = "POLICE 1";
case 2: str = "POLICE 2";
default: str = "POLCIE DEFAULT";
}
printf("Replace level %i to %s", level, str);
}