[HELP] LICENSES
#1

How can I create licenses? For Weapons and Vehicles?

Thanks in advance!
Reply
#2

Well, you will just need to create a variable for each weapon ( eg. weplic ) and save the variable's value in a player's file.

Something like:
pawn Код:
new weplic[MAX_PLAYERS];

CMD:buylic(playerid, params[])
{
    weplic[playerid] = 1;
    dini_IntSet(the-playerid-file, "weplic", 1);
    return 1;
}
And then check it whenever you want. And 1 is when a player has a weapon license, 0 is when a player does not have a weapon license. Same goes for driver's license.

This is not explained very much as the hour at my country is now 03:00 in the morning/night call it how you want. And I am tired as fuck. Anyway.. I hope you understood.. if not send me a PM. I will explain tomorrow as soon as I come back from school if not one else already explained.
Reply
#3

And this for everything? e.g. I want for motor bikes, cars, boats, helicopter??

new carlic[MAX_PLAYERS];
new bikelic[MAX_PLAYERS];
Reply
#4

mate?
Reply
#5

Yes it is.
Reply
#6

How do I ask this with if? I get an error :S

PHP код:
    new modelid=GetVehicleModel(GetPlayerVehicleID(playerid));
    if(
newstate==PLAYER_STATE_DRIVER)
    {
        if(
modelid==582 || modelid==488 || modelid==438 || modelid==426 || modelid=445)
        {
            if(
carlic[playerid]==0)
            {
            
            }
        }
    } 
Reply
#7

What error do you get?
Reply
#8

PHP код:
C:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : warning 211possibly unintended assignment
C
:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : error 022must be lvalue (non-constant)
C:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : warning 215expression has no effect
C
:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : error 001expected token";"but found ")"
C:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : error 029invalid expressionassumed zero
C
:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


4 Errors

Reply
#9

and?
Reply
#10

PHP код:
    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
    {
        new 
modelid=GetVehicleModel(GetPlayerVehicleID(playerid));
        if(
modelid==582 || modelid==488 || modelid==438 || modelid==426 || modelid=445)
        {
            if(
carlic[playerid]==0)
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playerid,red,"You have no drivers license");
            }
        }
    } 
still same error




PHP код:
C:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : warning 211possibly unintended assignment
C
:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : error 022must be lvalue (non-constant)
C:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : warning 215expression has no effect
C
:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : error 001expected token";"but found ")"
C:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : error 029invalid expressionassumed zero
C
:\Users\DanielsoN\Desktop\SAMP Server\gamemodes\tutorial.pwn(588) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)