• Welcome to Vice City Multiplayer.
 

How to use INI's for FBI duty

Started by saberman, March 08, 2011, 12:30:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

saberman

Here's my code:
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.

Dawood136

Problem Solved , Our Scripters Done ! There Job , fbiduty cmd is reinstalling
Signed,
Dawood Sahi
DSS RPG Owner/Leader

saberman

Quote from: Dawood136 on March 08, 2011, 01:40:50 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

Add this on top

new onduty[MAX_PLAYERS];

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


}
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

Quote from: Dawood136 on March 08, 2011, 01:40:50 PM
Problem Solved , Our Scripters Done ! There Job , fbiduty cmd is reinstalling

My msn not working meet ya at yahoo ok?

saberman

Got these errors when I debugged my file
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.

heekz.shadow

#6
Script made by heekz? omg :(

for COLOR_GREEN - upper #define COLOR_GREEN 0x33AA33AA

now show me line 716...


Pro Scripter[/b][/i][/u]

yazeen

Show line 756 and add

#define COLOR_GREEN 0x33AA33AA

Has shadow said and compile on top with all define files

saberman

Quote from: heekz.shadow on March 08, 2011, 05:17:41 PM
Script made by heekz? omg :(

for COLOR_GREEN - upper #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:
if(onduty[playerid] == 0) {

And here's the whole function and stuff...

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

BIG[H]

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
My Guru FORUM MUST VISITmegavcmp.freeforums.org

BIG[H] = BIG HaLL

saberman

Quote from: BIG[H] on March 09, 2011, 11:14:28 AM
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

Quote from: saberman on March 09, 2011, 11:18:13 AM
Quote from: BIG[H] on March 09, 2011, 11:14:28 AM
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

saberman

Quote from: yazeen on March 09, 2011, 01:30:15 PM
Quote from: saberman on March 09, 2011, 11:18:13 AM
Quote from: BIG[H] on March 09, 2011, 11:14:28 AM
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