need help
#1

Can Someone help To Correct This Code?

i tryd to make andromanda enter with score but it not gives a function .
Код:
public OnPlayerStateChange(playerid, newstate, oldstate){
if(newstate==PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592, GetPlayerScore(playerid) >= 500)
{
SendClientMessage(playerid, COLOR_YELLOW,"Welcome To Andromanda!");
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"You Need Atleast 500 Score To Enter Andromanda!");
new string[128];
format(string, sizeof(string), "Your Flight Score is: %i",GetPlayerScore(playerid));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
return 1;
}
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate==PLAYER_STATE_DRIVER)
    {
        if((GetVehicleModel(GetPlayerVehicleID(playerid)) == 592) && (GetPlayerScore(playerid) >= 500))
        {
            SendClientMessage(playerid, COLOR_YELLOW,"Welcome To Andromanda!");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_YELLOW,"You Need Atleast 500 Score To Enter Andromanda!");

            new string[128];
            format(string, sizeof(string), "Your Flight Score is: %i",GetPlayerScore(playerid));
            SendClientMessage(playerid, COLOR_YELLOW, string);
            return 1;
        }
    }
    return 1;
}
Try that. You had it like this.
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592, GetPlayerScore(playerid) >= 500)
It needs to be like this.
pawn Код:
if((GetVehicleModel(GetPlayerVehicleID(playerid)) == 592) && (GetPlayerScore(playerid) >= 500))
You don't have to have those extra parenthesis but it makes it easier to read.
Reply
#3

yeh thanks

i have to add this too

Код:
RemovePlayerFromVehicle(playerid);
Reply
#4

but if i try to enter hydra then it says same like andromanda and removes me .
Reply
#5

Use this.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate==PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592)
        {
            if(GetPlayerScore(playerid) >= 500)
            {
                SendClientMessage(playerid, COLOR_YELLOW,"Welcome To Andromanda!");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_YELLOW,"You Need Atleast 500 Score To Enter Andromanda!");

                new string[128];
                format(string, sizeof(string), "Your Flight Score is: %i",GetPlayerScore(playerid));
                SendClientMessage(playerid, COLOR_YELLOW, string);
                return 1;
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)