SA-MP Forums Archive
What's wrong ??? - 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: What's wrong ??? (/showthread.php?tid=582685)



What's wrong ??? - Mariciuc223 - 22.07.2015

Код:
new const fRanks[][] =
{
    { "", "", "", "", "", "", "" }, // Civilian
	{ "", "Cadet", "Officer", "Sergeant", "Lieutenant", "Captain", "Chief" }, // Police Departament
	{ "", "Professional Staff", "Special Agent", "Special Agent in Charge", "Assistant of Director", "Vice-Director", "Director" }, // Federal Bureau Of Investigation
	{ "", "Private", "Sergeant", "Major", "Captain", "Lieutenant", "General" }, // National Guard
	{ "", "Assistant", "Assistant In Charge", "Medic", "Paramedic", "Special Medic", "Chief Medic" }, // Medics/Fireman Departament
	{ "", "Intern", "Local Reporter", "Network Editor", "Network Anchor", "Journalist", "Network Producer" }, // News Reporters
	{ "", "Trainee", "Taxi Rookie", "Cabbie", "Despatcher", "Shift Supervisor", "Taxi Company Owner" }, // Taxi Cab Company
	{ "", "OutSider", "Soulja", "Gangsta", "Original Gangsta", "Double OG", "Grove King" }, // Grove Street Family
	{ "", "OutSider", "YoungBlood", "Gangsta", "Original Gangsta", "Double OG", "Balla' GodFather" }, // Ballas Gang
	{ "", "Cabron", "Vago", "Soldado", "Mafioso", "Derecha Mano", "Senior" }, // Los Santos Vagos
	{ "", "Cabron", "Vago", "Soldado", "Mafioso", "Derecha Mano", "Senior" }, // Varrios Los Aztecas
	{ "", "Soldado", "Caporale", "Sergente", "Luogotenente", "Colonnello", "Padrino" }, // La Cosa Nostra
	{ "", "Recuit", "Corporal", "Colonel", "Brigadier", "General", "WarLord" }, // Yakuza
	{ "", "Junior", "Drifter", "Legal Racer", "Event Maker", "Ilegal Racer", "Most Wanted" }, // For More Adrenaline
	{ "", "Lancer", "Marksman", "Agent", "Special Agent", "Vice-Director", "Director" } // Hitman Agency
};
What's wrong there .. When i set that in 1 message shown just "der" or "er" or that kind of texts...

Код:
new String[128];
format(String, sizeof(String), "Your rank it's %s !", fRanks[7][6]);
SendClientMessage(playerid, -1, String);
That's just an exemple ... But if i put that anywhere the text will appear "Your rank it's der !" or something like this ..


Re: What's wrong ??? - SpikY_ - 22.07.2015

try increasing the size of string.

your rank show in numbers or the name.?


AW: What's wrong ??? - Kaliber - 22.07.2015

Do it like this:

PHP код:
#define GetRank(%0,%1) fRanks[(%0)-1][(%1)-1]
stock const fRanks[][][] =
{
    { 
"Cadet""Officer""Sergeant""Lieutenant""Captain""Chief" }, // Police Departament
    
"Professional Staff""Special Agent""Special Agent in Charge""Assistant of Director""Vice-Director""Director" }, // Federal Bureau Of Investigation
    
"Private""Sergeant""Major""Captain""Lieutenant""General" }, // National Guard
    
"Assistant""Assistant In Charge""Medic""Paramedic""Special Medic""Chief Medic" }, // Medics/Fireman Departament
    
"Intern""Local Reporter""Network Editor""Network Anchor""Journalist""Network Producer" }, // News Reporters
    
"Trainee""Taxi Rookie""Cabbie""Despatcher""Shift Supervisor""Taxi Company Owner" }, // Taxi Cab Company
    
"OutSider""Soulja""Gangsta""Original Gangsta""Double OG""Grove King" }, // Grove Street Family
    
"OutSider""YoungBlood""Gangsta""Original Gangsta""Double OG""Balla' GodFather" }, // Ballas Gang
    
"Cabron""Vago""Soldado""Mafioso""Derecha Mano""Senior" }, // Los Santos Vagos
    
"Cabron""Vago""Soldado""Mafioso""Derecha Mano""Senior" }, // Varrios Los Aztecas
    
"Soldado""Caporale""Sergente""Luogotenente""Colonnello""Padrino" }, // La Cosa Nostra
    
"Recuit""Corporal""Colonel""Brigadier""General""WarLord" }, // Yakuza
    
"Junior""Drifter""Legal Racer""Event Maker""Ilegal Racer""Most Wanted" }, // For More Adrenaline
    
"Lancer""Marksman""Agent""Special Agent""Vice-Director""Director" // Hitman Agency
};
//Usage:
new String[128];
format(Stringsizeof(String), "Your rank it's %s !"GetRank(7,6));
SendClientMessage(playerid, -1String); 



Re: What's wrong ??? - Mariciuc223 - 22.07.2015

Quote:
Originally Posted by SpikY_
Посмотреть сообщение
try increasing the size of string.

your rank show in numbers or the name.?
When i use pInfo[playerid][pRank] it's show my rank correctly , but that string don't work ... And to put if(Faction == X & rank == X) .. it will take me a lot of space and time .. I need that fixed ..


AW: What's wrong ??? - Kaliber - 22.07.2015

Okay...ignore my correct answer


Re: AW: What's wrong ??? - Mariciuc223 - 22.07.2015

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Do it like this:

PHP код:
#define GetRank(%0,%1) fRanks[(%0)-1][(%1)-1]
stock const fRanks[][][] =
{
    { 
"Cadet""Officer""Sergeant""Lieutenant""Captain""Chief" }, // Police Departament
    
"Professional Staff""Special Agent""Special Agent in Charge""Assistant of Director""Vice-Director""Director" }, // Federal Bureau Of Investigation
    
"Private""Sergeant""Major""Captain""Lieutenant""General" }, // National Guard
    
"Assistant""Assistant In Charge""Medic""Paramedic""Special Medic""Chief Medic" }, // Medics/Fireman Departament
    
"Intern""Local Reporter""Network Editor""Network Anchor""Journalist""Network Producer" }, // News Reporters
    
"Trainee""Taxi Rookie""Cabbie""Despatcher""Shift Supervisor""Taxi Company Owner" }, // Taxi Cab Company
    
"OutSider""Soulja""Gangsta""Original Gangsta""Double OG""Grove King" }, // Grove Street Family
    
"OutSider""YoungBlood""Gangsta""Original Gangsta""Double OG""Balla' GodFather" }, // Ballas Gang
    
"Cabron""Vago""Soldado""Mafioso""Derecha Mano""Senior" }, // Los Santos Vagos
    
"Cabron""Vago""Soldado""Mafioso""Derecha Mano""Senior" }, // Varrios Los Aztecas
    
"Soldado""Caporale""Sergente""Luogotenente""Colonnello""Padrino" }, // La Cosa Nostra
    
"Recuit""Corporal""Colonel""Brigadier""General""WarLord" }, // Yakuza
    
"Junior""Drifter""Legal Racer""Event Maker""Ilegal Racer""Most Wanted" }, // For More Adrenaline
    
"Lancer""Marksman""Agent""Special Agent""Vice-Director""Director" // Hitman Agency
};
//Usage:
new String[128];
format(Stringsizeof(String), "Your rank it's %s !"GetRank(7,6));
SendClientMessage(playerid, -1String); 
You must spend some repotation blabla bla .. Thx you ... I can't give you rep

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Okay...ignore my correct answer
Didn't see you post