Author Topic: Cash!  (Read 2961 times)

0 Members and 1 Guest are viewing this topic.

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Cash!
« on: May 29, 2011, 07:51:55 am »
How do set the commands like /c heal and /c buywep cash? For example, you type /c heal and it take aways $200? aand when you type /c buywep colt.45 200 = $1500?
I'm beginning to feel like a Lag God, Lag God

Offline Scripter

  • Wiseguy
  • **
  • Posts: 62
    • View Profile
Re: Cash!
« Reply #1 on: May 29, 2011, 08:39:59 am »
for gups
Code: [Select]
else if (strcmp(cmd, "heal", true) == 0) {
new Float:Health; GetPlayerHealth(playerid,Health);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (GetPlayerMoney(playerid) < 200) SendClientMessage(playerid, GREEN,"[Error] - You need:$200 to heal.",GetPlayerMoney(playerid),200-GetPlayerMoney(playerid));
  else if (Health >= 100) SendClientMessage(playerid,COLOR_GREEN,"Error: You are healthy!");
else {
SetPlayerHealth(playerid,100.0);
DecPlayerHandCash(playerid,200);
    SendClientMessage(playerid,COLOR_GREEN,"You have been healed.");
}
return 1;
}
« Last Edit: May 29, 2011, 08:45:56 am by Scripter »

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Cash!
« Reply #2 on: May 30, 2011, 07:16:04 am »
for gups
Code: [Select]
else if (strcmp(cmd, "heal", true) == 0) {
new Float:Health; GetPlayerHealth(playerid,Health);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (GetPlayerMoney(playerid) < 200) SendClientMessage(playerid, GREEN,"[Error] - You need:$200 to heal.",GetPlayerMoney(playerid),200-GetPlayerMoney(playerid));
  else if (Health >= 100) SendClientMessage(playerid,COLOR_GREEN,"Error: You are healthy!");
else {
SetPlayerHealth(playerid,100.0);
DecPlayerHandCash(playerid,200);
    SendClientMessage(playerid,COLOR_GREEN,"You have been healed.");
}
return 1;
}
Is it the same thing for the weapons?
I'm beginning to feel like a Lag God, Lag God

Offline Scripter

  • Wiseguy
  • **
  • Posts: 62
    • View Profile
Re: Cash!
« Reply #3 on: May 30, 2011, 11:34:39 am »
add these two functions in ur weapon cmd or any other D

[pawn]else if (GetPlayerMoney(playerid) < 200) SendClientMessage(playerid, GREEN,"[Error] - You need:$200 to buy a wapon.",GetPlayerMoney(playerid),200-GetPlayerMoney(playerid));
DecPlayerHandCash(playerid,200);[/pawn]

Offline (SZ)Naruto

  • Street Thug
  • *
  • Posts: 33
  • PCS | European ProJect Counter Strike Server
    • View Profile
Re: Cash!
« Reply #4 on: June 07, 2011, 12:05:53 pm »
GOOD Xd