19.11.2009, 16:16
How do I make random spawns for players?
And how do I check if a player got enough money to buy something?
And how do I check if a player got enough money to buy something?
Originally Posted by [LCG
TANKER ]
best way is GetPlayerMoney and for the random spawn take a look at this example https://sampwiki.blast.hk/wiki/Random it will help you greatly with spawns and anything else that is related to being random :P |
if (strcmp(cmdtext, "/testcmd", true) == 0)
{
GivePlayerWeapon(playerid,46,1); // Parachute with 1 ammo. I want the person to pay $2500 for it and it detect if the person got enough money or it will prevent him from buying..
return 1;
}
if (strcmp(cmdtext, "/testcmd", true) == 0) { if(GetPlayerMoney(playerid) => 2500) { GivePlayerWeapon(playerid,46,1); // Parachute with 1 ammo. I want the person to pay $2500 for it and it detect if the person got enough money or it will prevent him from buying.. return 1; } else { // not enought money message return 1; } } return 0;
Originally Posted by [LCG
TANKER ]
try this, untested Код:
if (strcmp(cmdtext, "/testcmd", true) == 0) { if(GetPlayerMoney(playerid) => 2500) { GivePlayerWeapon(playerid,46,1); // Parachute with 1 ammo. I want the person to pay $2500 for it and it detect if the person got enough money or it will prevent him from buying.. return 1; } else { // not enought money message return 1; } } return 0; |