Author Topic: How to use INI's for FBI duty  (Read 5788 times)

0 Members and 2 Guests are viewing this topic.

Offline saberman

  • Street Thug
  • *
  • Posts: 22
    • View Profile
How to use INI's for FBI duty
« on: March 08, 2011, 03:30:24 pm »
Here's my code:
Code: [Select]
else if (strcmp(cmd, "fbiduty", true) == 0) {
    if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if(!IsPlayerCommandLevel(playerid,"fbiduty")) SendClientMessage(playerid, RED, "You Are Not A FBI Member");
else {
SetPlayerSkin(playerid, 3);
SetPlayerWeapon(playerid, 20, 300);
SetPlayerWeapon(playerid, 25, 300);
SetPlayerWeapon(playerid, 29, 100);
SetPlayerWeapon(playerid, 26, 400);
SetPlayerArmour(playerid, 100);
SetPlayerTeam(playerid, 15);
new name[20]; new string[128];
GetPlayerName(playerid, name, 20);
format(string, sizeof(string), "You are on FBI duty!", name);
SendClientMessage(playerid, BLUE, string);
}
return 1;
}
As you can see I am using (!IsPlayerCommandLevel, bla) in order to define the ranking system, I yet not know about the ini's.  I can create the ini's file but I am unable to control it on my GUPS file. Can any body help me how do I add the code for GUPS to control the ini's for this FBI duty.

Offline Dawood136

  • Street Thug
  • *
  • Posts: 28
    • View Profile
Re: How to use INI's for FBI duty
« Reply #1 on: March 08, 2011, 04:40:50 pm »
Problem Solved , Our Scripters Done ! There Job , fbiduty cmd is reinstalling
Signed,
Dawood Sahi
DSS RPG Owner/Leader

Offline saberman

  • Street Thug
  • *
  • Posts: 22
    • View Profile
Re: How to use INI's for FBI duty
« Reply #2 on: March 08, 2011, 05:10:40 pm »
Problem Solved , Our Scripters Done ! There Job , fbiduty cmd is reinstalling
No thanks I don't want help like you are giving.

Can anyone else tell me how to do it?

yazeen

  • Guest
Re: How to use INI's for FBI duty
« Reply #3 on: March 08, 2011, 05:41:31 pm »
Add this on top

new onduty[MAX_PLAYERS];

if gups change this to new fbiduty[MAX_PLAYERS]; to fbiduty and add it on pinfo


Code: [Select]
}
else if(strcmp(cmdtext,"onduty", true) == 0) {
if(onduty[playerid] == 0)
{
new file[256];
format(file, sizeof(file), CopsFile);
if(!dini_Exists(file)) {
dini_Create(file);
        }
new sepd[MAX_PLAYER_NAME]; GetPlayerName(playerid,sepd,sizeof(sepd));
if(!strcmp(sepd,dini_Get(file,"Enforcer")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,3);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,20,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Enforcer!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"Lietuant")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Lietuant!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
   else if(!strcmp(sepd,dini_Get(file,"Lietuant")))
   {
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Lietuant!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"attender")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as attender!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"undercover")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Undercover cop!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}

else if(!strcmp(sepd,dini_Get(file,"swat")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,18,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Swat!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"security")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,18,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as security guard!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}

else if(!strcmp(sepd,dini_Get(file,"Officer")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as a VCDP cop!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}

else if(!strcmp(sepd,dini_Get(file,"Fbi")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,102);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,18,1500);
SetPlayerWeapon(playerid,20,1500);
SetPlayerWeapon(playerid,23,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Fbi!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
}
return 1;
}

only players u like can be fbi,swat,etc 8)

Next step is make a folder called scriptfiles if it does not exist and then make a folder called cops in sciptfiles folder then make a notepad file or wordpad file and rename it as Copsrank then open it and add these lines example of name

fbi=[AsS]yazeen,fucker,maxtix
swat=
security=
"    "=
"    "=
"    "=
"    "=
"    "=

and save it

NExt step

}
      else if(strcmp(cmdtext,"offduty", true) == 0) {
   if(onduty[playerid] == 1)
   {
   SetSpikes(playerid,0);
   SetPlayerSkin(playerid,0);
   new string[256];
   format(string,sizeof(string),"[SE:PD News]: Officer %s is now off duty",gPlayers[playerid]);
   SendClientMessageToAll(COLOR_BLUE,string);
   onduty[playerid] = 0;
   swatsuit[playerid] = 0;
   SetPlayerTeam(playerid,-1);
   ResetPlayerWeapons(playerid);
   }
   return 1;
   }
   
these will set the player skin to defeault thats it :D
hope u like it

this script was made by heekz but i changed some for gups users
 8)

yazeen

  • Guest
Re: How to use INI's for FBI duty
« Reply #4 on: March 08, 2011, 05:43:06 pm »
Problem Solved , Our Scripters Done ! There Job , fbiduty cmd is reinstalling

My msn not working meet ya at yahoo ok?

Offline saberman

  • Street Thug
  • *
  • Posts: 22
    • View Profile
Re: How to use INI's for FBI duty
« Reply #5 on: March 08, 2011, 06:36:34 pm »
Got these errors when I debugged my file
Code: [Select]
C:\Users\Waleed Malik\Desktop\GUPS1.16a - Copy (2)\gamemodes\GUPS1.16.pwn(28) : warning 201: redefinition of constant/macro (symbol "COLOR_GREEN")
C:\Users\Waleed Malik\Desktop\GUPS1.16a - Copy (2)\gamemodes\GUPS1.16.pwn(756) : error 028: invalid subscript (not an array or too many subscripts): "onduty"
C:\Users\Waleed Malik\Desktop\GUPS1.16a - Copy (2)\gamemodes\GUPS1.16.pwn(756) : warning 215: expression has no effect
C:\Users\Waleed Malik\Desktop\GUPS1.16a - Copy (2)\gamemodes\GUPS1.16.pwn(756) : error 001: expected token: ";", but found "]"
C:\Users\Waleed Malik\Desktop\GUPS1.16a - Copy (2)\gamemodes\GUPS1.16.pwn(756) : error 029: invalid expression, assumed zero
C:\Users\Waleed Malik\Desktop\GUPS1.16a - Copy (2)\gamemodes\GUPS1.16.pwn(756) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase


4 Errors.

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: How to use INI's for FBI duty
« Reply #6 on: March 08, 2011, 08:17:41 pm »
Script made by heekz? omg :(

for COLOR_GREEN - upper
Code: [Select]
#define COLOR_GREEN 0x33AA33AA
now show me line 716...
« Last Edit: March 08, 2011, 08:22:07 pm by heekz.shadow »
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

yazeen

  • Guest
Re: How to use INI's for FBI duty
« Reply #7 on: March 09, 2011, 09:36:35 am »
Show line 756 and add

Code: [Select]
#define COLOR_GREEN 0x33AA33AA
Has shadow said and compile on top with all define files

Offline saberman

  • Street Thug
  • *
  • Posts: 22
    • View Profile
Re: How to use INI's for FBI duty
« Reply #8 on: March 09, 2011, 02:09:20 pm »
Script made by heekz? omg :(

for COLOR_GREEN - upper
Code: [Select]
#define COLOR_GREEN 0x33AA33AA
now show me line 716... (Correction by me - 756)

dw about the color error it gives me all the times but it does gives me the AMX file.

Here's the line:
Code: [Select]
if(onduty[playerid] == 0) {
And here's the whole function and stuff...

Code: [Select]
else if(strcmp(cmdtext,"onduty", true) == 0) {
if(onduty[playerid] == 0) {
new file[256];
format(file, sizeof(file), FBI_Ranks);
if(!dini_Exists(file)) {
dini_Create(file);
        }
new sepd[MAX_PLAYER_NAME]; GetPlayerName(playerid,sepd,sizeof(sepd));
if(!strcmp(sepd,dini_Get(file,"Enforcer")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,3);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,20,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Enforcer!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"Lietuant")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Lietuant!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
   else if(!strcmp(sepd,dini_Get(file,"Lietuant")))
   {
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Lietuant!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"attender")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as attender!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"undercover")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
SetPlayerWeapon(playerid,19,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Undercover cop!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}

else if(!strcmp(sepd,dini_Get(file,"swat")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,18,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Swat!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
else if(!strcmp(sepd,dini_Get(file,"security")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,18,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as security guard!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}

else if(!strcmp(sepd,dini_Get(file,"Officer")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,1);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,17,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as a VCDP cop!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}

else if(!strcmp(sepd,dini_Get(file,"Fbi")))
{
SetSpikes(playerid,1);
SetPlayerSkin(playerid,102);
ResetPlayerWeapons(playerid);
SetPlayerWeapon(playerid,4,1);
SetPlayerWeapon(playerid,18,1500);
SetPlayerWeapon(playerid,20,1500);
SetPlayerWeapon(playerid,23,1500);
format(szMsg,sizeof(szMsg),"%s is now on duty as Fbi!",gPlayers[playerid]);
SendClientMessageToAll(COLOR_BLUE,szMsg);
SetPlayerTeam(playerid,15);
onduty[playerid] = 1;
}
}
return 1;
}

It's all your script heekz :P

Offline BIG[H]

  • Made Man
  • ***
  • Posts: 159
  • Sight of light
    • View Profile
Re: How to use INI's for FBI duty
« Reply #9 on: March 09, 2011, 02:14:28 pm »
Man LOL
i am making it Just relax i made FBI duty that if player FBI he  can /c fbiduty its in USERS FILE
FBI=0 if its 1 then player can on duty else NO
Outdoor city server Administrator, FS server owner!

Offline saberman

  • Street Thug
  • *
  • Posts: 22
    • View Profile
Re: How to use INI's for FBI duty
« Reply #10 on: March 09, 2011, 02:18:13 pm »
Man LOL
i am making it Just relax i made FBI duty that if player FBI he  can /c fbiduty its in USERS FILE
FBI=0 if its 1 then player can on duty else NO
Okay lol, but do add a rank that one rank can give others a badge type of thing which will allow them to be FBI(badge = USERS = FBI) but I just wanted to know about it.

yazeen

  • Guest
Re: How to use INI's for FBI duty
« Reply #11 on: March 09, 2011, 04:30:15 pm »
Man LOL
i am making it Just relax i made FBI duty that if player FBI he  can /c fbiduty its in USERS FILE
FBI=0 if its 1 then player can on duty else NO
Okay lol, but do add a rank that one rank can give others a badge type of thing which will allow them to be FBI(badge = USERS = FBI) but I just wanted to know about it.

u want just Fbi? i can help

Offline saberman

  • Street Thug
  • *
  • Posts: 22
    • View Profile
Re: How to use INI's for FBI duty
« Reply #12 on: March 09, 2011, 05:29:02 pm »
Man LOL
i am making it Just relax i made FBI duty that if player FBI he  can /c fbiduty its in USERS FILE
FBI=0 if its 1 then player can on duty else NO
Okay lol, but do add a rank that one rank can give others a badge type of thing which will allow them to be FBI(badge = USERS = FBI) but I just wanted to know about it.

u want just Fbi? i can help

Yes, okay. And do add if possible that I can set FBI=1 in game in the server.
* saberman locks the topic
* saberman put's a anti-unlock system
* saberman completely lock's it