SA-MP Forums Archive
[HELP] LICENSES - 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)
+--- Thread: [HELP] LICENSES (/showthread.php?tid=423197)



[HELP] LICENSES - NuggaN - 16.03.2013

How can I create licenses? For Weapons and Vehicles?

Thanks in advance!


Re: [HELP] LICENSES - Denying - 16.03.2013

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.


Re: [HELP] LICENSES - NuggaN - 16.03.2013

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

new carlic[MAX_PLAYERS];
new bikelic[MAX_PLAYERS];


Re: [HELP] LICENSES - NuggaN - 16.03.2013

mate?


Re: [HELP] LICENSES - BigGroter - 16.03.2013

Yes it is.


Re: [HELP] LICENSES - NuggaN - 17.03.2013

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)
            {
            
            }
        }
    } 



Re: [HELP] LICENSES - Don_Cage - 17.03.2013

What error do you get?


Re: [HELP] LICENSES - NuggaN - 17.03.2013

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




Re: [HELP] LICENSES - NuggaN - 17.03.2013

and?


Re: [HELP] LICENSES - NuggaN - 17.03.2013

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