20.07.2012, 11:03
pawn Код:
CMD:invite(playerid,params[])
{
if(pInfo[playerid][pLeader] >= 1)
{
return SendClientMessage(playerid,-1,"You May not Use this command");
}
new ftext[50], pName[MAX_PLAYER_NAME],iName[MAX_PLAYER_NAME],id,string[128];
if(sscanf(params,"u",id))
{
return SendClientMessage(playerid,-1,"USAGE:/invite [id/partofname]");
}
if(pInfo[playerid][pLeader] == 1)
{
ftext = "LSPD";
SetPlayerSkin(id,288);
pInfo[id][pMember] = pInfo[playerid][pLeader];
pInfo[id][pRank] = 1;
}
else if(pInfo[playerid][pLeader] == 2)
{
ftext = "NCR";
SetPlayerSkin(id,287);
pInfo[id][pMember] = pInfo[playerid][pLeader];
pInfo[id][pRank] = 1;
}
else
{
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(id,iName,sizeof(iName));
format(string,sizeof(string),"You Have been invited to %s by the Leader %s",ftext,pName);
SendClientMessage(id,COLOR_BLUE,string);
format(string,sizeof(string),"You have invited %s to Join %s",iName,ftext);
SendClientMessage(playerid,COLOR_BLUE,string);
}
return 1;
}