Codes trouble..Some help
#1

Hi guys i found this code:
PHP код:
if (GetPlayerWantedLevel(plId) == 0)
                        {
                            
SendClientMessage(playerid0xFF0000AA"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
Reply
#2

pawn Код:
new Float:Health;
    GetPlayerHealth(plId, Health);
    if(Health == 0)
    {
        SendClientMessage(playerid, 0xFF0000AA, "This player is ...");
        return 1;
    }
Reply
#3

ok,thanks man
Reply
#4

its works thx +1rep,,something else ,how i can check if player is in at ambulance?
Reply
#5

pawn Код:
if(GetVehicleModel(vehicleid) == 416)
Reply
#6

Ok thanx again, but i get this
C:\Users\Дзмзфсзт\Documents\server 0.3E\gamemodes\newtest.pwn(3162) : error 017: undefined symbol "vehicleid"
Reply
#7

pawn Код:
new vehicleid = GetPlayerVehicleID(plId);
Reply
#8

anyway i set this: COMMAND:heal(playerid,params[],vehicleid)
its works?
Reply
#9

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

ok
thx
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)