Help with this command. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with this command. (
/showthread.php?tid=361185)
Help with this command. -
Gangster-rocks - 20.07.2012
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;
}
I'm a leader of LSPD when i try to invite and budy its tall me You may not use this commad.
Re: Help with this command. -
Infinity90 - 20.07.2012
Edit this part
pawn Код:
if(pInfo[playerid][pLeader] >= 1) return SendClientMessage(playerid,-1,"You May not Use this command");
{
If that doesn't work, your /makeleader command will not be setting the pLeader as 1.
Re: Help with this command. -
Andi_Evandy - 20.07.2012
pawn Код:
if(pInfo[playerid][pLeader] >= 1)
change it to:
pawn Код:
if(pInfo[playerid][pLeader] < 1)