cargodmode desenable in derby ?
#1

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 ?
Reply
#2

Should be:

if(derbygodupfuck[playerid] == 0 && IsPlayerInAnyVehicle(playerid))
Reply
#3

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;
}
Reply
#4

i love you it works thanks a lot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)