new DMV[MAX_PLAYERS]; // We will use this to set every single player's DMV to 1 or 0 according to the file
if (strcmp("/dmv", cmdtext, true, 4) == 0) // The command
{
if(!dini_Exists("dmv.cfg") dini_Create("dmv.cfg") // If the file is not in your scriptfiles folder the script will create it
if(dini_Int("dmv.cfg", "dmv") == 0) // if dmv in the file is = 0
{
dini_IntSet("dmv.cfg", "dmv", "1"); // Set dmv=1 in the file
SendClientMessage(playerid, 0xFFFFFFFF, "You have set DMV to 1.");
}
else if(dini_Int("dmv.cfg", "dmv") == 1) // if dmv in the file is = 1
{
dini_IntSet("dmv.cfg", "dmv", "0"); // Set dmv=0 in the file
SendClientMessage(playerid, 0xFFFFFFFF, "You have set DMV to 0.");
}
for(new i=0; i<MAX_PLAYERS; i++) // loop to set connected players DMV to the value from file
{
if(IsPlayerConnected(i))
{
DMV[i] = dini_Int("dmv.cfg", "dmv");
}
}
return 1;
}
DMV[playerid] = dini_Int("dmv.cfg", "dmv"); // Set the player's DMV to the value in file
if(dini_Int("dmv.cfg", "dmv") == 0) // if dmv in the file is = 0
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your DMV is 1.");
}
else if(dini_Int("dmv.cfg", "dmv") == 1) // if dmv in the file is = 1
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your DMV is 1.");
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buylicense", cmdtext, true, 4) == 0) // The command
{
if(!dini_Exists("dmv.cfg") dini_Create("dmv.cfg") // If the file is not in your scriptfiles folder the script will create it
if(dini_Int("dmv.cfg", "dmv") == 0) // if dmv in the file is = 0
{
dini_IntSet("dmv.cfg", "dmv", "1"); // Set dmv=1 in the file
SendClientMessage(playerid, -1, "(INFO) You bought a legal driving license.");
GivePlayerMoney(playerid, -1000);
}
else if(dini_Int("dmv.cfg", "dmv") == 1) // if dmv in the file is = 1
{
dini_IntSet("dmv.cfg", "dmv", "1"); // Set dmv=0 in the file
SendClientMessage(playerid, 0xFFFFFFFF, "(INFO) You already have a driving license.");
}
for(new i=0; i<MAX_PLAYERS; i++) // loop to set connected players DMV to the value from file
{
if(IsPlayerConnected(i))
{
DMV[i] = dini_Int("dmv.cfg", "dmv");
}
}
return 1;
}
return 0;
}
C:\Users\Luca\Desktop\dmvlicense.pwn(95) : error 001: expected token: ")", but found "-identifier-" C:\Users\Luca\Desktop\dmvlicense.pwn(96) : error 001: expected token: ";", but found "if" C:\Users\Luca\Desktop\dmvlicense.pwn(9 ![]() C:\Users\Luca\Desktop\dmvlicense.pwn(104) : error 035: argument type mismatch (argument 3) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |