#1

Hello .. I have a small problem .. In my server there is command "/buffalo" . And it has set that when i type this then 10k goes off my cash .. But it goes into minus . But i want it to tell like : "You dont have enought money" or something like that..

Script ( thats just a part of that .. there are some weapons and other cars with same problem :/ ) :


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/buffalo", true)==0) {
   new Float:X, Float:Y, Float:Z, buffalo;
   GetPlayerPos(playerid, X, Y, Z);
   buffalo = CreateVehicle(402, X, Y, Z, 0.0, -1, -1, -1);
   PutPlayerInVehicle(playerid, buffalo, 0);
   GivePlayerMoney(playerid, -10000);
   SendClientMessage(playerid, 0x33AA33AA, "Gratz, you bought Chevy Camaro ( buffalo )");
   return 1;
}
Reply
#2

if (GetPlayerMoney(playerid) < 100000) return SendClientMessage(playerid,COLOR_RED, "You don't have enough money");

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp(cmdtext, "/buffalo", true)==0) {
   if (GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,COLOR_RED, "You don't have enough  money");
   new Float:X, Float:Y, Float:Z, buffalo;
   GetPlayerPos(playerid, X, Y, Z);
   buffalo = CreateVehicle(402, X, Y, Z, 0.0, -1, -1, -1);
   PutPlayerInVehicle(playerid, buffalo, 0);
   GivePlayerMoney(playerid, -10000);
   SendClientMessage(playerid, 0x33AA33AA, "You bought a Chevy Camaro (Buffalo)");
   return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)