Help creating cmd - 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 creating cmd (
/showthread.php?tid=662923)
Help creating cmd -
dani44 - 16.01.2019
I need to create a cmd /factionleaders to show all facs with its leader.
I would like to edit it IG so any ideas?
Thanks
Re: Help creating cmd -
ApolloScripter - 16.01.2019
Hello
dani44, you can use the properties and variables of your GM, just create a Loop through all players / factions id and print them and do what's best for you.
Logical example:
PHP код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerLeader(i))
{
printf("%s", PlayerName(i));
}
}
IsPlayerLeader is a function that you can create to check, you can do the same with the factions, just adapt the loop according to your need.
You can take a better look by
CLICKING HERE.
Re: Help creating cmd -
dani44 - 16.01.2019
Quote:
Originally Posted by ApolloScripter
Hello dani44, you can use the properties and variables of your GM, just create a Loop through all players / factions id and print them and do what's best for you.
Logical example:
PHP код:
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerLeader(i)) { printf("%s", PlayerName(i)); } }
IsPlayerLeader is a function that you can create to check, you can do the same with the factions, just adapt the loop according to your need.
You can take a better look by CLICKING HERE.
|
I can try it but how should i edit that ingame if a leader changes?
Re: Help creating cmd -
ApolloScripter - 16.01.2019
Quote:
Originally Posted by dani44
I can try it but how should i edit that ingame if a leader changes?
|
Ok, let's assume that you store the name of each leader in a variable name [50]; Whenever this variable changes, the loop will change too, but like I said, you need to see how this works in your GM
Re: Help creating cmd -
dani44 - 17.01.2019
Solved, close please.