#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
new policegun1;
new policegun2;
new policegun3;
new policegun4;
new policegun5;
public OnFilterScriptInit()
{
UsePlayerPedAnims();
CreatePickup(1242, 3, 2507.8369, -1656.8049, 13.5938);
CreatePickup(336, 3, 2510.3140, -1659.4635, 13.5938);
CreatePickup(348, 3, 2512.6199, -1668.4495, 13.5628);
CreatePickup(355, 3, 2511.4939, -1675.6918, 13.5451);
CreatePickup(350, 3, 2501.7224, -1685.2773, 13.4716);
//Politie
policegun1 = CreatePickup(1242, 3, 1585.9580, -1691.9110, 6.2188);
policegun2 = CreatePickup(356, 3, 1586.9224, -1679.2471, 5.8970);
policegun3 = CreatePickup(353, 3, 1586.4342, -1683.5643, 6.2252);
policegun4 = CreatePickup(346, 3, 1586.2582, -1687.6957, 6.2188);
policegun5 = CreatePickup(359, 3, 1587.1272, -1675.2145, 5.8973);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == policegun1){
SetPlayerArmour(playerid, 100);
}
if(pickupid == policegun2){
SetPlayerAmmo(playerid, 5, 1000);
}
if(pickupid == policegun3){
SetPlayerAmmo(playerid, 4, 1000);
}
if(pickupid == policegun4){
SetPlayerAmmo(playerid, 2, 1000);
}
if(pickupid == policegun5){
SetPlayerAmmo(playerid, 7, 25);
}
return 1;
}
if(pickupid == policegun1) {
SetPlayerArmour(playerid, 100);
}
else if(pickupid == policegun2) {
SetPlayerAmmo(playerid, 5, 500);
}
//just continue with the others also using the "else if"-statements!
Hi!
Under "OnPlayerPickUpPickup", you have to use from the second pickup on the "else if" statment! Would look like this: PHP код:
|
and 1st make sures about your teams
it would be better if you add #include <a_samp> #define COPS 1 #define CRIMINALS 2 #define FILTERSCRIPT #if defined FILTERSCRIPT //make sure there spawn and add a gmaemode name too your server it could be just confussing you coz of no teams and nothing first make sure that a basic beta GM is redy and then try to make and add pickups ![]() |
SetPlayerAmmo(playerid, pickupid , 1000);
weird how you got your numbers try this
pawn Код:
and about the if it dont really matter either way, only difference is the else if will stop checking once condition is met, using just if's means it will check every one everytime which is not really needed here. but wont break the code. |
{ if(pickupid == policegun1) { SetPlayerArmour(playerid, 100); } if(pickupid == policegun2) { SetPlayerAmmo(playerid, 5, 1000); } if(pickupid == policegun3) { SetPlayerAmmo(playerid, 4, 1000); } if(pickupid == policegun4) { SetPlayerAmmo(playerid, 2, 1000); } if(pickupid == policegun5) { SetPlayerAmmo(playerid, 7, 25); } return 1; }