13.09.2011, 01:16
It's kind of hard to explain. I want to make it so players can get weapons without a timer, but not the armor. This is my current code:
If you don't get what I mean, just ask. Thanks for the help
pawn Код:
COMMAND:getweapons(playerid, cmdtext)
{
if (!IsPlayerInRangeOfPoint(playerid, 7.0, 2196.2363,-3319.5674,192) && !IsPlayerInRangeOfPoint(playerid, 7.0, 2160.5581,-3017.5974,191))
{
SendClientMessage(playerid, 0xFF0000FF, "You're not near the weapon crates"); return 1;
}
ShowPlayerDialog(playerid, 32, DIALOG_STYLE_LIST, "Pick a weapon:", "Deagle\nCombat Shotgun\nAK47\nTearGas\nChainsaw\nSniper\nMinigun\nFlamethrower\nVest", "Pick", "Close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 32)
{
if(!response) return 1; // if he clicked the other button, stop the code
switch(listitem) // Switch trough all list items
{
case 0: GivePlayerWeapon(playerid, 24, 100);
case 1: GivePlayerWeapon(playerid, 27, 100);
case 2: GivePlayerWeapon(playerid, 30, 200);
case 3: GivePlayerWeapon(playerid, 17, 10);
case 4: GivePlayerWeapon(playerid, 9, 1);
case 5: GivePlayerWeapon(playerid, 34, 100);
case 6: GivePlayerWeapon(playerid, 38, 500);
case 7: GivePlayerWeapon(playerid, 37, 500);
case 8: SetPlayerArmour(playerid, 100); // I want this to have a timer
}
}
return 1;
}