Medic Heal player in ambulance
#1

Solved
Reply
#2

Try that (didn't test it..):
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new index, cmd[20];
    cmd = strtok(cmdtext, index);
    if(strcmp(cmd, "/soigner", true) == 0)
    {
        new vid = GetVehicleModel(vehicleid);
        if(vid != 416) return SendClientMessage(playerid, COLOR_RED, "You are not in an ambulance!");
        new seat = GetPlayerVehicleSeat(playerid);
        if(seat == 1 || seat == 2 || seat == 3)
        {
            if(cTeam[playerid] == TEAM_MEDIC)
            {
                new tmp[20], id;
                tmp = strtok(cmdtext, index);
                if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /soigner [playerid]");
                id = strval(tmp);
                if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID)
                {
                    SetPlayerHealth(id, 100.0);
                    SendClientMessage(id, COLOR_LIGHTBLUE, "Vous avez e'te' soigne' par un medecin.");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vous soignez cette personne.");
                }
                else return SendClientMessage(playerid, 0xFF0000AA, "[x] Cette personne n'existe pas.");//that's person don't exist
            }
            else return SendClientMessage(playerid, COLOR_RED, "Vous n'e^tes pas me'decin");
        }
        else return SendClientMessage(playerid, COLOR_RED, "You are not a passenger!");
        return 1;
    }
    return 0; // Returns SERVER: Unknown command.
}
Reply
#3

Thanks alot
I'm going to try this, I'll informe you in 20minutes
Reply
#4

Erf, i have that's error :
error 017: undefined symbol "vehicleid"

Код:
 new index, cmd[20];
    cmd = strtok(cmdtext, index);
    if(strcmp(cmd, "/soigner", true) == 0)
    {
        new vid = GetVehicleModel(vehicleid);
        if(vid != 416) return SendClientMessage(playerid, COLOR_RED, "[x] Vous n'кtes pas dans une ambulance !");
        new seat = GetPlayerVehicleSeat(playerid);
        if(seat == 1 || seat == 2 || seat == 3)
        {

What should i do ?
Reply
#5

replace vehicleid with GetPlayerVehicleID(playerid)
edit: sorry i meant vehicleid
Reply
#6

thanks alot that's compile but the code don't work
When i go in ambulance he say "you're not in ambulance"
:/
thanks alot for help
Reply
#7

up please. Thanks
Reply
#8

Replace
pawn Код:
new vid = GetVehicleModel(vehicleid);
With
pawn Код:
new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
Reply
#9

Very FULLY BIG THANKS ALOT all, that's work !
Thanks _rAped too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)