How would i do reserved skins? -
JAMMIEISFTW - 23.05.2012
How would i make a reserved skin, so its reserved for a certain player in the class selection list.
Re: How would i do reserved skins? -
ViniBorn - 23.05.2012
Look
OnPlayerRequestClass
Re: How would i do reserved skins? -
[FMJ]PowerSurge - 23.05.2012
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 294) // Wu-Zi-Mu
{
if(strcmp(name, "JAMMIEISFTW", false)) //Name, do not ignore case
{
GameTextForPlayer(playerid, "~r~Restricted skin!", 3000, 5);
return 0; //Stop spawning
}
}
}
Or even
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 0) // CJ
{
if(!IsPlayerAdmin(playerid)) //Are they RCON admin? If not...
{
GameTextForPlayer(playerid, "~r~Restricted skin!", 3000, 5);
return 0; //...Stop spawning
}
}
}
Re: How would i do reserved skins? -
JAMMIEISFTW - 23.05.2012
But how do i do it so its ONLY For a certain player name?
Re: How would i do reserved skins? -
[FMJ]PowerSurge - 23.05.2012
The first one. Just change the name.
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 294) // Wu-Zi-Mu
{
new name[24]; GetPlayerName(playerid, name, 24);
if(strcmp(name, "JAMMIEISFTW", false)) //Name, do not ignore case
{
GameTextForPlayer(playerid, "~r~Restricted skin!", 3000, 5);
return 0; //Stop spawning
}
}
}
pawn Код:
if(strcmp(name, "JAMMIEISFTW", false)) //Name, do not ignore case
Re: How would i do reserved skins? -
JAMMIEISFTW - 23.05.2012
C:\Users\Public\Documents\neww\gamemodes\SFCRRPG.p wn(17136) : error 021: symbol already defined: "OnPlayerRequestSpawn"
EDIT:
HERES THE MAIN CODE FOR CLASS SELECTION...
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
if (!udb_Exists(PlayerName(playerid)))
{
ShowRegisterScreen(playerid);
return 0;
}
if (!PLAYERLIST_authed[playerid]) {
ShowLoginScreen(playerid);
return 0;
}
if(gTeam[playerid] < 9 && SavedWantedLevel[playerid] != 0)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot use this class as you were wanted last time you left the server.");
return 0;
}
if(gTeam[playerid] < 9 && SavedJailTime[playerid] != 0)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot use this class as you were in jail last time you left the server.");
return 0;
}
if(gTeam[playerid] == TEAM_ARMY && CanUseArmy[playerid] != 1337)
{
SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. ");
return 0;
}
if(gTeam[playerid] == TEAM_CIA && CanUseCIA[playerid] != 1337)
{
SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. ");
return 0;
}
if(GetPlayerSkin(playerid) == 286 && GetPlayerScore(playerid) <= 499)
{
SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. You must gain 500 score before using this class.");
return 0;
}
if(gTeam[playerid] == TEAM_COP && GetPlayerScore(playerid) <= 49)
{
SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. You must gain 50 score before using this class.");
return 0;
}
return 1;
}
Heres What I Added
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 208)
{
new name[24]; GetPlayerName(playerid, name, 24);
if(strcmp(name, "TheKiller", false)) //Name, do not ignore case
{
GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
return 0; //Stop spawning
}
}
}
Re: How would i do reserved skins? -
HighPitchedVoice - 23.05.2012
You already got one "OnPlayerRequestSpawn", add it in under that..
Re: How would i do reserved skins? -
[FMJ]PowerSurge - 23.05.2012
pawn Код:
if(GetPlayerSkin(playerid) == 208)
{
new name[24]; GetPlayerName(playerid, name, 24);
if(strcmp(name, "TheKiller", false)) //Name, do not ignore case
{
GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
return 0; //Stop spawning
}
}
Add that to your already-existing public.
Re: How would i do reserved skins? -
JAMMIEISFTW - 23.05.2012
C:\Users\Public\Documents\neww\gamemodes\SFCRRPG.p wn(11013) : error 010: invalid function or declaration
pawn Код:
if(GetPlayerSkin(playerid) == 208)
{
new name[24]; GetPlayerName(playerid, name, 24);
if(strcmp(name, "TheKiller", false)) //Name, do not ignore case
{
GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
return 0; //Stop spawning
}
}
}
return 1;
}
Line 11013
EDIT: NVM
Re: How would i do reserved skins? -
CristiD - 23.05.2012
Try
pawn Код:
if(GetPlayerSkin(playerid) == 208)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
if(strcmp(pName,"TheKiller",false) == 0)
{
GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
return 0;
}
}
I'm not sure about return 0