/givelicense help
#1

pawn Код:
new license[MAX_PLAYERS];
pawn Код:
dini_IntSet(file,"license", license[playerid]);
(under on player disconnect)

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(license[playerid] == 0)
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOUR_RED,"You don't have a license");
    return 1;
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        if(license[playerid] == 0)
        {
            RemovePlayerFromVehicle(playerid);
            return 1;
        }
          else
        {
          return 1;
        }

    }
    return 1;
}
pawn Код:
license[playerid] = dini_Int(file,"license");
(under login)

pawn Код:
dini_IntSet(file,"license", 0);
To the problem: So I am trying to make a RP server, and I will start by adding a /givelicense command. The problem is that
when I do the command is that:

1. "You don't have a license" still are there when you enter a vehicle
2. It works until you log out. It won't work if you log in.

So all in all, it works, but it wont save, and the error won't go away.


Thanks in advance
Reply
#2

Forgot the command..


pawn Код:
dcmd_givelicense(playerid,params[])
{
    if(admin[playerid] <= 3) return 0;
    new pid;
    if(sscanf(params,"i",pid)) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /givelicense [playerid]");
    else if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, 0xFF0000FF, "There is no player online with that id online");
    else
    {
        new name[MAX_PLAYER_NAME],string[128];
        GetPlayerName(pid,name,sizeof(name));
        license[pid] = 1;
        format(string,sizeof(string),"An admin gave you license");
        SendClientMessage(pid,0xF60000AA,string);
        return 1;
    }

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)