SA-MP Forums Archive
4 warnings - 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: 4 warnings (/showthread.php?tid=169836)



4 warnings - Typhome - 21.08.2010

Код:
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6511) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6532) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6561) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6582) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
6511
Код:
if(GetPlayerHealth(playerid) >= 1)
6532
Код:
if(GetPlayerHealth(playerid) >= 1)
6561
Код:
if(GetPlayerHealth(playerid) >= 1)
6582
Код:
if(GetPlayerHealth(playerid) >= 1)



Re: 4 warnings - Sky4D - 21.08.2010

You're not using GetPlayerHealth correctly.
pawn Код:
new Float:playerHealth;
GetPlayerHealth(playerid, playerHealth);
if(playerHealth >= 1)
{
//blah
}



Re: 4 warnings - willsuckformoney - 21.08.2010

Yeah the above post should work, if it doesn't post back.


Re: 4 warnings - michaelw352 - 21.08.2010

Use the samp wiki next time,ok?


Re: 4 warnings - Typhome - 21.08.2010

Quote:
Originally Posted by Sky4D
Посмотреть сообщение
You're not using GetPlayerHealth correctly.
pawn Код:
new Float:playerHealth;
GetPlayerHealth(playerid, playerHealth);
if(playerHealth >= 1)
{
//blah
}
Код:
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6513) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6534) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6565) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6586) : warning 202: number of arguments does not match definition
:/ Still 4 warnings.

Quote:
Originally Posted by michaelw352
Посмотреть сообщение
Use the samp wiki next time,ok?
Go fuck your mom up, retard.


Re: 4 warnings - Sky4D - 21.08.2010

Quote:
Originally Posted by Typhome
Посмотреть сообщение
Код:
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6513) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6534) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6565) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6586) : warning 202: number of arguments does not match definition
:/ Still 4 warnings but new warning.
Is it on the same lines?


Re: 4 warnings - Typhome - 21.08.2010

It's about:

GetPlayerHealth(playerid, VehicleHealthStack[vehicleid][2]);
SetPlayerHealth(playerid, floatsub(VehicleHealthStack[vehicleid][2], 6));
if(GetPlayerHealth(playerid) >= 1)

Yes same line


Re: 4 warnings - Sky4D - 21.08.2010

Quote:
Originally Posted by Typhome
Посмотреть сообщение
It's about:

GetPlayerHealth(playerid, VehicleHealthStack[vehicleid][2]);
SetPlayerHealth(playerid, floatsub(VehicleHealthStack[vehicleid][2], 6));
if(GetPlayerHealth(playerid) >= 1)

Yes same line
You're still doing it wrong.

pawn Код:
GetPlayerHealth(playerid, VehicleHealthStack[vehicleid][2]);
SetPlayerHealth(playerid, floatsub(VehicleHealthStack[vehicleid][2], 6));
if(VehicleHealthStack[vehicleid][2] >= 1)
Something like that.


Re: 4 warnings - Typhome - 21.08.2010

Full code at 2 warning's:

Код:
public VehicleDamageToPlayerHealth(playerid, vehicleid)
{
   	if (IsPlayerInVehicle(playerid,vehicleid))
	{
		if(Seatbelt[playerid] == 1)
		{
  			GetVehicleHealth(vehicleid, VehicleHealthStack[vehicleid][0]);
   			if (floatcmp(VehicleHealthStack[vehicleid][0], VehicleHealthStack[vehicleid][1]) == -1)
    		{
    	       	GetPlayerHealth(playerid, VehicleHealthStack[vehicleid][2]);
    	       	SetPlayerHealth(playerid, floatsub(VehicleHealthStack[vehicleid][2], 6));
    	       	if(GetPlayerHealth(playerid) >= 1)
				{
				    SendClientMessage(playerid,COLOR_CORAL,"You are shook up from the collision.");
				    SendClientMessage(playerid,COLOR_CORAL,"Luckily, you were wearing your seatbelt and may continue driving.");
				}
				else
				{
				    SendClientMessage(playerid,COLOR_CORAL,"Your stamina was in bad condition and the force of the collision knocked you out.");
					GameTextForPlayer(playerid,"~r~Out ~w~cold",4000,1);
				}
    		}
    	   	VehicleHealthStack[vehicleid][1] = VehicleHealthStack[vehicleid][0];
    	   	return 1;
   		}
		else
		{
			GetVehicleHealth(vehicleid, VehicleHealthStack[vehicleid][0]);
   			if (floatcmp(VehicleHealthStack[vehicleid][0], VehicleHealthStack[vehicleid][1]) == -1)
    		{
    	       	GetPlayerHealth(playerid, VehicleHealthStack[vehicleid][2]);
    	       	SetPlayerHealth(playerid, floatsub(VehicleHealthStack[vehicleid][2], 45));
    	       	if(GetPlayerHealth(playerid) >= 1)
				{
				    SendClientMessage(playerid,COLOR_CORAL,"You are shook up from the collision.");
				    SendClientMessage(playerid,COLOR_CORAL,"You can not continue driving, as you are frozen from shock. Buckle up, next time.");
					TogglePlayerControllable(playerid, 0);
					TimerStack = SetTimerEx("DisablePlayerKnockout",3500,1,"i",playerid);
				}
				else
				{
				    SendClientMessage(playerid,COLOR_CORAL,"Your stamina was in bad condition and the force of the collision knocked you out.");
					GameTextForPlayer(playerid,"~r~Out ~w~cold",4000,1);
				}
    		}
    	   	VehicleHealthStack[vehicleid][1] = VehicleHealthStack[vehicleid][0];
    	   	return 1;
		}
	}
	return 1;
}



Re: 4 warnings - Kyosaur - 21.08.2010

Quote:
Originally Posted by Typhome
Посмотреть сообщение
Код:
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6513) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6534) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6565) : warning 202: number of arguments does not match definition
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(6586) : warning 202: number of arguments does not match definition
:/ Still 4 warnings.



Go fuck your mom up, retard.
How about you stop being a rude prick or get the fuck off these forums? The previous poster was completely correct, you should ALWAYS check the wiki first, there is nothing wrong with his post that warranted your vulgar comment.

You warnings are from you not having the right set of parameters (check the wiki on the functions that are giving the warnings to see their parameters).