/bonus > nefungue - 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: /bonus > nefungue (
/showthread.php?tid=78034)
/bonus > nefungue -
ToMmY1547 - 16.05.2009
Cau lidi tak vcera sem si nakodil takovej malej scriptik a dnes kdyz sem zkousel mod tak ten script blbne kod:
Код:
dcmd_bonus(playerid, params[])
{
#pragma unused params
if(IsPlayerConnected(playerid))
{
new bool:bonused[MAX_PLAYERS] = true;
if(bonused[playerid] == false)
{
bonused[playerid] = true;
EnableStuntBonusForPlayer(playerid, 1);
SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis zapnul ukazovani bonusu.");
}
else if(bonused[playerid] == true)
{
bonused[playerid] = false;
EnableStuntBonusForPlayer(playerid, 0);
SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis vypnul ukazovani bonusu.");
}
}
return true;
}
Vzdy kdyz zadam prikaz: /bonus tak se vzdy ukaze pouze: Prave jsis vypnul ukazovani bonusu.
A ja uz nwm vcem je problem tak pls help. Predem diky
I'm Czech :P xD
Re: /bonus > nefungue -
ToMmY1547 - 16.05.2009
Pls help
Re: /bonus > nefungue -
miokie - 16.05.2009
This is a
english ONLY speaking forum. Please re-type your post in english.
Re: /bonus > nefungue -
ToMmY1547 - 16.05.2009
It is the command does not work, always proves the same text.
Re: /bonus > nefungue -
member - 16.05.2009
You keep creating the variable in the command, so you would keep getting the message:
"Prave jsis zapnul ukazovani bonusu."
Do this:
Under
OnGameModeInit:
pawn Код:
new bool:bonused[MAX_PLAYERS] = true;
the command:
pawn Код:
dcmd_bonus(playerid, params[])
{
#pragma unused params
if(IsPlayerConnected(playerid))
{
if(bonused[playerid] == false)
{
bonused[playerid] = true;
EnableStuntBonusForPlayer(playerid, 1);
SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis zapnul ukazovani bonusu.");
}
else if(bonused[playerid] == true)
{
bonused[playerid] = false;
EnableStuntBonusForPlayer(playerid, 0);
SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis vypnul ukazovani bonusu.");
}
}
return true;
}
Re: /bonus > nefungue -
ToMmY1547 - 16.05.2009
Quote:
|
Originally Posted by [B2K
Hustler ]
You keep creating the variable in the command, so you would keep getting the message:
"Prave jsis zapnul ukazovani bonusu."
Do this:
Under OnGameModeInit:
pawn Код:
new bool:bonused[MAX_PLAYERS] = true;
the command:
pawn Код:
dcmd_bonus(playerid, params[]) { #pragma unused params if(IsPlayerConnected(playerid)) { if(bonused[playerid] == false) { bonused[playerid] = true; EnableStuntBonusForPlayer(playerid, 1); SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis zapnul ukazovani bonusu."); } else if(bonused[playerid] == true) { bonused[playerid] = false; EnableStuntBonusForPlayer(playerid, 0); SendClientMessage(playerid, BARVA_ZELENA, "Prave jsis vypnul ukazovani bonusu."); } } return true; }
|
Thank you, it works.