01.05.2012, 19:30
(
Последний раз редактировалось pyrodave; 01.05.2012 в 21:33.
)
pawn Код:
stock strreplace(string[], find, replace)
{
new len = strlen(string);
while(len--)
{
if(string[len] == find) string[len] = replace;
}
return string;
}
pawn Код:
CMD:setfaction(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 5) return SendClientMessage(playerid, COLOR_RED, " ** You need to be a level 5 admin to do that!");
new otherplayerid;
new faction;
new pName[MAX_PLAYER_NAME], gName[MAX_PLAYER_NAME];
if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_RED, " ** They are not online!");
if(sscanf(params, "u", otherplayerid, faction)) return SendClientMessage(playerid, COLOR_RED, "Use /setfaction [playerid/name] [faction number 1 - 11]");
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(otherplayerid, gName, MAX_PLAYER_NAME);
SendClientMessage(otherplayerid, COLOR_GREEN, " ** Admin %s has set your faction to %s",pName,faction);
SendClientMessage(playerid, COLOR_GREEN, " ** You have set player %s faction to %s",gName,faction);
PlayerInfo[otherplayerid][gTeam] = faction;
return 1;
}