Help me - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me (
/showthread.php?tid=85314)
Help me -
6tynine - 06.07.2009
pawn Код:
if (strcmp(text,"1",true) == 0)
{
new Playermoney = GetPlayerMoney(playerid);
if (Playermoney >= 900)
{
SendClientMessage(playerid,0x38FF06FF,"$900 Whore");
GivePlayerMoney(playerid, -900);
GivePlayerWeapon(playerid,24,120);
IsInCheckPoint[playerid] = 1;
return 0;
}
SendClientMessage(playerid,0x38FF06FF,"You Do not have enough Cash");
}
When I have Above $900 I get gun id 24
When I dont have $900 I get the Message: You Do not have enough Cash
Which is great but It also makes me say: 1. Is there a way to fix this?
Re: Help me -
Correlli - 06.07.2009
If you don't want to pay for weapon then just remove player-money-check.
Re: Help me -
6tynine - 06.07.2009
Quote:
Originally Posted by Don Correlli
If you don't want to pay for weapon then just remove player-money-check.
|
-.- The money Check is fine. I just want the message saying: You Do not have enough Cash
And not me saying 1 in the chat
Re: Help me -
refshal - 06.07.2009
pawn Код:
if (strcmp(text,"1",true) == 0)
{
new Playermoney = GetPlayerMoney(playerid);
if (Playermoney >= 900)
{
SendClientMessage(playerid,0x38FF06FF,"$900 Whore");
GivePlayerMoney(playerid, -900);
GivePlayerWeapon(playerid,24,120);
IsInCheckPoint[playerid] = 1;
return 1;
}
else return SendClientMessage(playerid,0x38FF06FF,"You Do not have enough Cash");
}
Try that one.
Re: Help me -
6tynine - 06.07.2009
Edit:
Nah Still makes me say 1
Re: Help me -
6tynine - 06.07.2009
pawn Код:
if(IsInCheckPoint[playerid] == 1)
{
switch(text)
{
case 0:
{
if (strcmp(text,"1",true) == 0)
{
new Playermoney = GetPlayerMoney(playerid);
if (Playermoney > 900)
{
SendClientMessage(playerid,0x38FF06FF,"[DEBUG] DEAGLE");
GivePlayerMoney(playerid, -900);
GivePlayerWeapon(playerid,24,120);
IsInCheckPoint[playerid] = 1;
return false;
}
else
{
SendClientMessage(playerid, 0x000000, "You don't have 900$.");
}
}
case 1:
{
if(strcmp(text,"2",true) == 0)
{
if( Playermoney > 1000 )
{
SendClientMessage(playerid,0x38FF06FF,"Selection 2");
IsInCheckPoint[playerid] = 1;
return false;
}
else
{
SendClientMessage(playerid, 0x000000, "You don't have 1000$");
}
}
}
return true;
}
Ok I tried that But I get errors
error 033: array must be indexed (variable "-unknown-")
switch(text)
error 014: invalid statement; not in switch
case 1
error 001: expected token: ";", but found ":"
case 1
error 029: invalid expression, assumed zero
case 1
fatal error 107: too many error messages on one line
case 1
Re: Help me -
BMUK - 06.07.2009
You need to return 0 to close the '
if (strcmp(text,"1",true) == 0) ' or it will still send the "1" to the chat... That whole switch thing your doing doesnt make much sense
In your
first post: Change the
last ' } ' to this:
And your good to go!
Re: Help me -
6tynine - 06.07.2009
WTF ??!!!!!
[me=M4DKiLLA]GIVES A BIG KISS TO BMUK[/me]
Cheers mate