Posts: 284
Threads: 86
Joined: Nov 2016
Reputation:
0
Is there any evidence for Cops ranks?
Example: If the PoliceMan arrest someone +1arrest for him and if he got 350arrest update his rank to 2 Like that... how to do that? Just give me a example... because i dont have any idea
Posts: 168
Threads: 54
Joined: Jan 2015
Reputation:
0
new Arrest[MAX_PLAYERS];
new rank[MAX_PLAYERS];
CMD:arrest(playerid, params[])
{
if(Arrest[playerid] >= 350) ranker[playerid] ++;
}
just check it when he arresting someone
Posts: 284
Threads: 86
Joined: Nov 2016
Reputation:
0
How to save the ranks? and how to make names for ranks.!!
Posts: 89
Threads: 22
Joined: Jul 2017
Reputation:
0
It's like the same of the login and register, like you save the passwords, And ip's, You save the rank with them too, Also that depends on the include you use, MySQL or Dini, Can you give me the code of the register command/dialog please?
Also, You'll have to test when player talks, if he got specific rank, just put the rank name next to it, Just give me the code of register command or dialog and i will show you how
Posts: 168
Threads: 54
Joined: Jan 2015
Reputation:
0
You might look around for some saving tutorial but for making rankname, you could make it dynamic like leaders are able to edit it, just save it in the database, or use the array
enum rankinfo
{
name[64],
factionid
};
new rank[][rankinfo] =
{
{"PO1", 1},
//... something
{"Chief of Police", 1}
};
for call them just do
you might use it like
do SetPVarInt(playerid, "Rank", 1);
then /myrank
format(string, sizeof(string), "your rank is %d", rank[GetPVarInt(playerid, "rank")][name]);
SendClientMessage(playerid, -1, string);
and it would say your rank is 1