Codes trouble..Some help - 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)
+--- Thread: Codes trouble..Some help (
/showthread.php?tid=359245)
Codes trouble..Some help -
jimis - 13.07.2012
Hi guys i found this code:
PHP код:
if (GetPlayerWantedLevel(plId) == 0)
{
SendClientMessage(playerid, 0xFF0000AA, "This Player Is Not
Wanted!");
return 1;
}
But i want check player health and not wanted level.. How i can replace it??
Some help..
Thanks
Re: Codes trouble..Some help -
clarencecuzz - 13.07.2012
pawn Код:
new Float:Health;
GetPlayerHealth(plId, Health);
if(Health == 0)
{
SendClientMessage(playerid, 0xFF0000AA, "This player is ...");
return 1;
}
Re: Codes trouble..Some help -
jimis - 13.07.2012
ok,thanks man
Re: Codes trouble..Some help -
jimis - 13.07.2012
its works thx +1rep,,something else ,how i can check if player is in at ambulance?
Re: Codes trouble..Some help -
clarencecuzz - 13.07.2012
pawn Код:
if(GetVehicleModel(vehicleid) == 416)
Re: Codes trouble..Some help -
jimis - 13.07.2012
Ok thanx again, but i get this
C:\Users\Дзмзфсзт\Documents\server 0.3E\gamemodes\newtest.pwn(3162) : error 017: undefined symbol "vehicleid"
Re: Codes trouble..Some help -
CmZxC - 13.07.2012
pawn Код:
new vehicleid = GetPlayerVehicleID(plId);
Re: Codes trouble..Some help -
jimis - 13.07.2012
anyway i set this: COMMAND:heal(playerid,params[],vehicleid)
its works?
Re: Codes trouble..Some help -
CmZxC - 13.07.2012
No, you'll have to do some further development. and the "vehicleid" is invalid parameter in CMD:
EDIT: For example -
pawn Код:
#include <a_samp>
#include <zcmd>
CMD:heal(playerid, params[])
{
#pragma unused params
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 416)
{
SetPlayerHealth(playerid, 100.0);
}
else
{
return SendClientMessage(playerid, -1, " You're not in an ambulance !");
}
return 1;
}
Re: Codes trouble..Some help -
jimis - 13.07.2012
ok
thx