How to make goldpot minigame - 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: How to make goldpot minigame (
/showthread.php?tid=185786)
How to make goldpot minigame -
[WSF]ThA_Devil - 26.10.2010
i was wondering... how can i make this minigame...
on top:
in ongamemodeint:
pawn Код:
SetTimer("GoldPot", 180000, true);
and in Goldpot
pawn Код:
forward GoldPot(playerid);
public GoldPot(playerid)
{
switch(random(4))//
{
if(case 0)
{
//my funct here
}
else if(case 1)
{
//my funct here
}
else if(case 2)
{
//my funct here
}
else if(case 3)
{
//my funct here
}
}
}
and
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == goldpotpickup)
{
GivePlayerMoney(playerid,10000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
DestroyPickup(goldpotpickup);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has Won Goldpot! ($10000+1 score)!",name);
SendClientMessageToAll(COLOR_GREEN, string);
return 1;
}
return 0;
}
i got some erros:
Код:
(592): error 002: only a single statement (or expression) can follow each "case"
(592) : error 029: invalid expression, assumed zero
(592) : error 029: invalid expression, assumed zero
(592) : fatal error 107: too many error messages on one line
error line is here:
pawn Код:
forward GoldPot(playerid);
public GoldPot(playerid)
{
switch(random(4))//
{
if(case 0) //error line
{
//myfucnt
}
else if(case 1)
{
//myfunct
}
else if(case 2)
{
//myfunct
}
else if(case 3)
{
//myfunct
}
}
}
Re: How to make goldpot minigame -
rbN. - 26.10.2010
It's not if(case), but its case:
So:
pawn Код:
case 0:
{
First
}
case 1:
{
Second
}
Re: How to make goldpot minigame -
[WSF]ThA_Devil - 26.10.2010
thanks
it worked!