cargodmode desenable in derby ? - 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: cargodmode desenable in derby ? (
/showthread.php?tid=103903)
cargodmode desenable in derby ? -
a-day - 21.10.2009
hello everybody iґll hope that somone can help me
so i have a derby but i have a cargodmode in my server too
bud when user join the derby there cars dont explode because the the godmode works
i have try this to desenable this are my codes
the godmode:
Код:
public ScanVehicleHealth(){
new Float:HP, v;
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(derbygodupfuck[playerid] == false && IsPlayerInAnyVehicle(playerid))
{
v=GetPlayerVehicleID(playerid);
GetVehicleHealth(v,Float:HP);
if(Float:HP < 250)
{
SetVehicleHealth(v,900);
}
}
}
}
the derby command :
Код:
if(strcmp(cmdtext, "/derby", true) == 0)
{
derbygodupfuck[playerid]= true;
new name[MAX_PLAYER_NAME];
new string[100];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), ">>> %s ist im Derby /derby <<<", name);
SendClientMessageToAll(0x2EB8FFFF, string);
SetPlayerInterior(playerid,15);
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerPos(playerid,-1443.5715,933.3106,1036.4977);
return 1;
}
i have put this in my all other commands
Код:
derbygodupfuck[playerid]= false;
so when i compile i get this warn
Код:
C:\Dokumente und Einstellungen\ante\Desktop\ls\stuntlantis.pwn(849) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
line 849 is :
Код:
if(derbygodupfuck[playerid] == false && IsPlayerInAnyVehicle(playerid))
whats wrong ?
Re: cargodmode desenable in derby ? -
Andom - 21.10.2009
Should be:
if(derbygodupfuck[playerid] == 0 && IsPlayerInAnyVehicle(playerid))
Re: cargodmode desenable in derby ? -
Correlli - 21.10.2009
You can only check for
false or
true if you set a
bool: tag to a variable (which means you can only use 0 or 1 (but only as false or true) - binary compositions).
Like:
pawn Код:
new
bool:myVariable;
stock myFunction(playerid)
{
if(myVariable == true) return 1;
else return 0;
}
But if you use it like this (your case):
pawn Код:
new
myVariable;
stock myFunction(playerid)
{
if(myVariable == true) return 1;
else return 0;
}
You'll get the same warning (warning 213: tag mismatch) because your variable is just a normal variable.
Or like this:
pawn Код:
new
bool:myVariable;
stock myFunction(playerid)
{
if(myVariable == 1) return 1;
else return 0;
}
Re: cargodmode desenable in derby ? -
a-day - 21.10.2009
i love you it works thanks a lot