It seems that you've set the whole script up incorrectly.
With this line here,
Код:
if(PlayerTemp[_id][hname]) myStrcpy(sender, "Stranger-%d", maskid);
When you come out of the brackets, you're finishing your if statement. Therefore anything after that is just gibberish. But it's not giving you any errors in terms of that because it's in a language that the compiler can understand. Also that if statement is empty, because you're not comparing it to anything. It'll give you an error once you've fixed the one you're currently having. When using an if statement you're normally asking the compiler something. For example.
I might ask how the weather is. Two answers could be sunny or raining. So therefore the if statement would be
Код:
if(weather == sunny)
{
do....
}
else if(weather == raining)
{
do something else...
}
Whenever you're asking something (or creating an if statement) there has to be a "do" something after it. Otherwise it's completely pointless. You're asking the compiler IF the weather is sunny but you're not telling it what to do after the compiler figures out that the weather is sunny. So a more understanding piece of code I suppose would be like this.
Код:
if(weather == sunny)
{
SendClientMessageToAll(RED, "[WEATHER UPDATE]: The weather is sunny! Enjoy the beautiful sunshine!");
}
else if(weather == raining)
{
SendClientMessageToAll(RED, "[WEATHER UPDATE]: The weather is raining! Please drive carefully!");
}
I hope that explains to you why you're having the issue you're having. Since in your if statement you are firstly not comparing it to anything you're merely just saying:
You aren't asking anything or comparing anything. As I don't know how your script is set out or anything like that I'm going to guess and show you how it should hopefully work.
Also a piece of advise, don't use the word 'stock' in front of the function as it isn't good coding practice.
Read this link for more.
https://sampforum.blast.hk/showthread.php?tid=570635
Back to your code.
Код:
MaskedName(playerid)//There doesn't need to be the word 'stock' in front of the function.
{
new sender[MAX_PLAYER_NAME];
new maskid = minrand(10000,99999);
if(PlayerTemp[playerid][hname] == 1)//Asking the compiler if PlayerTemp hname is equal to one (I'm guessing hname is if the player has hidden their name)
{
myStrcpy(sender, "Stranger-%d", maskid);//It'll display Stranger and the maskid that was randomized in line 4.
}
else if(PlayerTemp[playerid][hname] == 0)//If the player doesn't have their name hidden
{
myStrcpy(sender, RPName(playerid));//It'll display the players Roleplay name.
}
return sender;
}
I hope this helps you. If you have anymore questions don't hesitate to ask.