if(GetPlayerCash(playerid) >= 1000000) // Checks if the player has it.
{
GivePlayerCash(playerid,-1000000); // Takes it away.
pawn Код:
|
if(strcmp(cmd, "/weaponspack", true) == 0) {
if(GetPlayerCash(playerid) >= 1000000) // Checks if the player has it.
{
GivePlayerCash(playerid,-1000000); // Takes it away.
GivePlayerWeapon(playerid, 24, 650);
GivePlayerWeapon(playerid, 31, 650);
GivePlayerWeapon(playerid, 26, 650);
SetPlayerHealth(playerid, 100);
SetPlayerArmor(playerid, 100);
return 1;
)
if(strcmp(cmd, "/weaponspack", true) == 0) {
if(GetPlayerCash(playerid) >= 1000000) // Checks if the player has it.
{
GivePlayerCash(playerid,-1000000); // Takes it away.
GivePlayerWeapon(playerid, 24, 650);
GivePlayerWeapon(playerid, 31, 650);
GivePlayerWeapon(playerid, 26, 650);
SetPlayerHealth(playerid, 100);
SetPlayerArmor(playerid, 100);
}else return SendClientMessage(playerid, colorid, "you dont have enough cash!");
return 1;
)
stock GetPlayerCash(playerid)
{
return Cash[playerid];
}
stock GivePlayerCash(playerid, money)
{
Cash[playerid]+=money;
SetPlayerMoney(playerid,Cash[playerid]);
return 1;
}
if(strcmp(cmd, "/weaponspack", true) == 0) {
if(PlayerConnected(playerid))
{
if(GetPlayerCash(playerid) >= 1000000) // Checks if the player has it.
{
GivePlayerCash(playerid,-1000000); // Takes it away.
GivePlayerWeapon(playerid, 24, 650);
GivePlayerWeapon(playerid, 31, 650);
GivePlayerWeapon(playerid, 26, 650);
SetPlayerHealth(playerid, 100);
SetPlayerArmor(playerid, 100);
{
else
}
SendClientMessage(playerid, *COLOR*, "You do not have the right ammount of cash for these items!");
}
return 1;
}
C:\Users\azd\Desktop\samp03bsvr_R2_win32\gamemodes\Fruity150.pwn(35) : error 017: undefined symbol "Cash" C:\Users\azd\Desktop\samp03bsvr_R2_win32\gamemodes\Fruity150.pwn(35) : warning 215: expression has no effect C:\Users\azd\Desktop\samp03bsvr_R2_win32\gamemodes\Fruity150.pwn(35) : error 001: expected token: ";", but found "]" C:\Users\azd\Desktop\samp03bsvr_R2_win32\gamemodes\Fruity150.pwn(35) : error 029: invalid expression, assumed zero C:\Users\azd\Desktop\samp03bsvr_R2_win32\gamemodes\Fruity150.pwn(35) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
return Cash[playerid];
if(strcmp(cmd, "/weaponspack", true) == 0) { if(PlayerConnected(playerid)) { if(GetPlayerMoney(playerid) >= 1000000) // Checks if the player has it. { GivePlayerMoney(playerid,-1000000); // Takes it away. GivePlayerWeapon(playerid, 24, 650); GivePlayerWeapon(playerid, 31, 650); GivePlayerWeapon(playerid, 26, 650); SetPlayerHealth(playerid, 100); SetPlayerArmor(playerid, 100); { else } SendClientMessage(playerid, *COLOR*, "You do not have the right ammount of cash for these items!"); } return 1; }
stock SetPlayerCash(playerid, money)
{
Cash[playerid] = money;
}
Why have double stocks when the functions are already there? Seems a bit of an overkill. Use SmugglesJr's code.
|