Posts: 239
Threads: 69
Joined: Jun 2011
So i jotted down some ideas and thought about making a script that i had no info, or background image about! So hes the code.
Код:
SetupPlayerForClassSelection(playerid);
new skin = GetPlayerSkin(playerid);
if(skin == 117)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
if(strcmp( Name, "HayZatic"))
{
SendClientMessage(playerid, RED, "Welcome HayZatic");
}
else
{
GameTextForPlayer(playerid, "Only For HayZatic!", 5000, 5);
return 0;
}
}
return 1;
I Compiled No Errors, but it seems like when i go into game the skin dosnt appear! Why?
Posts: 977
Threads: 10
Joined: Apr 2011
Reputation:
0
You're using a custom function, SetupPlayerForClassSelection. I'm assuming you want to apply this code for when the player presses the Spawn button? If so, you should place this code under the OnPlayerRequestSpawn callback.
Posts: 239
Threads: 69
Joined: Jun 2011
Quote:
Originally Posted by Bakr
You're using a custom function, SetupPlayerForClassSelection. I'm assuming you want to apply this code for when the player presses the Spawn button? If so, you should place this code under the OnPlayerRequestSpawn callback.
|
I Tried This And it did the Same Same Thing as the First Callback still, any ideas? Do you want me to paste the script for you to see?
Posts: 815
Threads: 65
Joined: May 2010
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(classid == 117) //Whichever classid the skin is
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
if(strcmp( Name, "HayZatic", false))
{
SendClientMessage(playerid, RED, "Welcome HayZatic");
}
else
{
GameTextForPlayer(playerid, "Only For HayZatic!", 5000, 5);
return 0;
}
}
return 1;
}
Posts: 977
Threads: 10
Joined: Apr 2011
Reputation:
0
Sorry, I misread your code. Are you placing this code under the OnPlayerRequestClass callback? If not, do so.
And is it the skin or classid that you want to check?
Posts: 1,363
Threads: 14
Joined: Apr 2009
Reputation:
0
I believe he's adding it to OnPlayerConnect since he has the
SendClientMessage(playerid, RED, "Welcome HayZatic");
which is also wrong, getting a players skin onplayerconnect will return 0 since they only get a skinid OnPlayerRequestClass
Posts: 239
Threads: 69
Joined: Jun 2011
I want it to check if its HayZatic picking Skin id.
I only want HayZatic To Pick That Skin
Posts: 239
Threads: 69
Joined: Jun 2011
After All of this, It finally worked! Thanks Guys!