On top:
new grove[MAX_PLAYERS];
new cop[MAX_PLAYERS];
The command using ZCMD
pawn Код:
COMMAND:invite(playerid,params[])
{
new id,factionname[50];
if(sscanf(params,"us[50]",id,factionname)) return SendClientMessage(playerid,COLOR_RED,"HINT: /invite [playerid] [factionname]");
else
{
if(!strcmp(factionname,"lspd",true))
{
ShowPlayerDialog(id,1,DIALOG_STYLE_MSGBOX,"Faction Invite","You've been invited for Los Santos Police Department","Accept","Cancel");
}
else if(!strcmp(factionname,"grove",true))
{
ShowPlayerDialog(id,2,DIALOG_STYLE_MSGBOX,"Faction Invite","You've been invited for Grove Street Families","Accept","Cancel");
}
else
{
SendClientMessage(playerid,COLOR_RED,"Invalid choice");
SendClientMessage(playerid,COLOR_GREY,"Valid Choices: lspd,grove");
}
}
return 1;
}
@ onplayerdialog response
pawn Код:
if (dialogid == 1)
{
if(!response) return SendClientMessage(playerid, COLOR_RED, "You canceled!");
cop[playerid] = 1;
SetPlayerSkin(playerid,SKINID);
SendClientMessage(playerid,COLOR_BLUE,"You've joined Los Santos Police Department");
}
else
if (dialogid == 2)
{
if(!response) return SendClientMessage(playerid, COLOR_RED, "You canceled!");
grove[playerid] = 1;
SetPlayerSkin(playerid,SKINID);
SendClientMessage(playerid,COLOR_GREEN,"You've joined Grove Street Families");
}
Alright. I'm not sure if this works. I wrote this and not tested it.
I'm not even sure why I've made this for you since this isn't the script request thread.
I hope it works
Greets.
EDIT:
You already bumped your post like in 15 minutes.
The rule is that you can't bump your thread within 48 hours (Which I think is way to long)
I can deal with bumping in 5-6 hours. That won't annoy me.
But this is to fast.
Other rules:
https://sampforum.blast.hk/showthread.php?tid=45235