when player enter car
#1

hi guys, i want wen player enters any vehicle, it say "drive safely!"

how i do this?
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new string[128];
    format(string, sizeof(string), "You are entering vehicle %i",vehicleid);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
Reply
#3

use OnPlayerStateChange

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        SendClientMessage(playerid, -1, "Drive Safety!");
    }
    return 1;
}
Reply
#4

Here fixed it as you want. Such add the define line on the top near all other color definitions.

pawn Код:
#define COLOR_GREEN           0x33AA33AA
//Add the above line on the top of all the other color definitions.

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        SendClientMessage(playerid, COLOR_GREEN, "Drive Safely!");
    GameTextForPlayer(playerid, "~g~Drive Safely", 1000, 3);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)