02.12.2015, 02:44
(
Последний раз редактировалось Counterafk; 02.12.2015 в 06:30.
)
Hi. So I want to create a code which lets the player pick a weapon set at spawn, but I dont know how I'd do it.
What I've got so far:
This is pretty much where I got stuck. How would I proceed? Should I create a public?
How would I make it so that when I Respawn it gives me the weaponset I selected?
Thanks!
(Sorry if there were any grammar mistakes 4:40am as I am writing this)
What I've got so far:
Код:
OnPlayerConnect
{
ShowMenu[playerid] = 1;
return 1;
}
Код:
OnPlayerSpawn
{
if(ShowMenu[playerid] == 1)
{
ShowPlayerDialog(playerid, DIALOG_SHOWMENU, DIALOG_STYLE_TABLIST, "Spawn weapons",
"Weapon set 1:\t Deagle\t$0\n\
Weapon set 2:\t Deagle, shotgun\t$500\n\
Weapon set 3:\t Deagle, shotgun, M4\t$500", //
"Select", "Close");
}
Код:
OnDialogResponse
if(dialogid == DIALOG_SHOWMENU)
{
if(!response)
{
ShowPlayerDialog(playerid, DIALOG_SHOWMENU, DIALOG_STYLE_TABLIST, "Spawn weapons",
"Weapon set 1:\t Deagle\t$0\n\
Weapon set 2:\t Deagle, shotgun\t$500\n\
Weapon set 3:\t Deagle, shotgun, M4\t$500", //
"Select", "Close");
}
else
{
switch(listitem)
{
case 0: SetTimerEx("SpawnprotectionGuns", 2500, false, "i", playerid);(playerid)
case 1: SetTimerEx("SpawnprotectionGuns", 2500, false, "i", playerid);(playerid)
case 2: SetTimerEx("SpawnprotectionGuns", 2500, false, "i", playerid);(playerid)
}
Код:
forward SpawnprotectionGuns(playerid);
public SpawnprotectionGuns(playerid)
{
SpawnProtection[playerid] = 0;
SendClientMessage(playerid, 0xAFAFAFAA, "SERVER: Spawn protection has ended!");
GivePlayerWeapon(playerid, 24, 50); // perhaps something here?
}
return 1;
}
This is pretty much where I got stuck. How would I proceed? Should I create a public?
How would I make it so that when I Respawn it gives me the weaponset I selected?
Thanks!
(Sorry if there were any grammar mistakes 4:40am as I am writing this)

