STOCK Problem!
#1

Nothing happens if I use this, whats the matter?

stock GetFactionIDByName(frakname[])
{

if(!strcmp(frakname,"LSPD,",true))
{
return 1;
}
else if(!strcmp(frakname,"FBI,",true))
{
return 2;
}
else if(!strcmp(frakname,"Bundeswehr,",true))
{
return 3;
}
else if(!strcmp(frakname,"Sanitдter,",true))
{
return 4;
}
else if(!strcmp(frakname,"LCM,",true))
{
return 5;
}
else if(!strcmp(frakname,"Yakuza,",true))
{
return 6;
}
else if(!strcmp(frakname,"Prдsident,",true))
{
return 7;
}
else if(!strcmp(frakname,"Hitman,",true))
{
return 8;
}
else if(!strcmp(frakname,"San News,",true))
{
return 9;
}
else if(!strcmp(frakname,"Transport GmbH,",true))
{
return 10;
}
else if(!strcmp(frakname,"Fahrlehrer,",true))
{
return 11;
}
else if(!strcmp(frakname,"Triaden,",true))
{
return 12;
}
else if(!strcmp(frakname,"Grove,",true))
{
return 13;
}
else if(!strcmp(frakname,"Ballas,",true))
{
return 14;
}
else if(!strcmp(frakname,"Feuerwehr,",true))
{
return 15;
}
else if(!strcmp(frakname,"Vagos,",true))
{
return 16;
}
else if(!strcmp(frakname,"Aztecas,",true))
{
return 17;
}
else if(!strcmp(frakname,"SF Rifa,",true))
{
return 18;
}
else if(!strcmp(frakname,"Red Soldiers,",true))
{
return 19;
}
else if(!strcmp(frakname,"Terroristen,",true))
{
return 20;
}
else if(!strcmp(frakname,"Wheelmen Agency,",true))
{
return 21;
}
else if(!strcmp(frakname,"S.W.A.T,",true))
{
return 22;
}
else if(!strcmp(frakname,"Russen Mafia",true))
{
return 23;
}
else if(!strcmp(frakname,"Ordnungsamt",true))
{
return 24;
}
else return 9999;
}
Reply
#2

remove , from inside strings "LSPD," "LSPD"
Reply
#3

You should provide more details.What you were expecting to happen? What you getting now?And properly ident and enclose the code in [php] or [code] tags so that others can read it.
Reply
#4

Mugala was right but.

Maybe there is something wrong with strmcp ?

https://pastebin.com/pkXpQ5Qj
Reply
#5

nothing wrong, but there are some better ways.
isn't it working?
Reply
#6

No and Idk why

https://pastebin.com/ukuApLSt
Reply
#7

first code is correct, you get only 9999 in first one?
Reply
#8

Try by ID and not by name it will work

Code:
stock GetFactionNameByID(classid)
{
    new String[30];
    switch(classid)
    {
        case 0: String = "Class One";
        case 1: String = "Class Two";
    }
    return String;
}
Reply
#9

Quote:
Originally Posted by NeXTGoD
View Post
Try by ID and not by name it will work

Code:
stock GetFactionNameByID(classid)
{
    new String[30];
    switch(classid)
    {
        case 0: String = "Class One";
        case 1: String = "Class Two";
    }
    return String;
}
yeah but he wants to get by name, there is a big difference.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)