SA-MP Forums Archive
Medic Heal player in ambulance - 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: Medic Heal player in ambulance (/showthread.php?tid=207876)



Medic Heal player in ambulance - Vukilore - 07.01.2011

Solved


Re: Medic Heal player in ambulance - Toreno - 07.01.2011

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.
}



Re : Medic Heal player in ambulance - Vukilore - 07.01.2011

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


Re : Medic Heal player in ambulance - Vukilore - 07.01.2011

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 ?


Re: Medic Heal player in ambulance - veyron - 07.01.2011

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


Re : Medic Heal player in ambulance - Vukilore - 07.01.2011

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


Re : Medic Heal player in ambulance - Vukilore - 11.01.2011

up please. Thanks


Re: Medic Heal player in ambulance - _rAped - 11.01.2011

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



Re : Medic Heal player in ambulance - Vukilore - 12.01.2011

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