Private Skin's Problem! -
Santox14 - 17.10.2011
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "[LSB]TheGame") == 0)
{
AddPlayerClass(21,1980.7158,-1231.5333,24.8155,98.0888,0,0,0,0,0,0);
}
if(strcmp(name, "[LSB]TheGame") == 1)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid,0xFF0019FF,"You are not [LSB]TheGame, press F4 and choose another Skin!");
}
I can spawn with this skin with any name , how can i fix this? help me please.
Re: Private Skin's Problem! -
Dark_Kostas - 17.10.2011
You can name-check at
OnPlayerSpawn if the
skin is allowed and then
force him to the skin selection again(you have to kill him)
AW: Private Skin's Problem! -
Santox14 - 17.10.2011
thanks and how? in totally a noob in Scripting
.
Re: Private Skin's Problem! -
Dark_Kostas - 17.10.2011
You can look the links through the post i made. They contain useful information about each callback/function. You can find examples there.
Re: Private Skin's Problem! -
SmiT - 17.10.2011
pawn Код:
public OnPlayerSpawn(playerid)
{
new
PlayerName[MAX_PLAYER_NAME];
GetPlayerName( playerid, PlayerName, MAX_PLAYER_NAME );
if( GetPlayerSkin ( playerid ) == 21 )
{
if( !strcmp ( PlayerName, "[LSB]TheGame" ) )
{
SendClientMessage( playerid, -1, "Allowed to use this skin " );
}
else
{
ForceClassSelection( playerid );
SetPlayerHealth( playerid, 0 );
SendClientMessage( playerid, -1 ,"You are not [LSB]TheGame, choose another Skin!" );
}
}
return true;
}
AW: Private Skin's Problem! -
Santox14 - 17.10.2011
look i got a gangsystem and i want my own skin that only i can use/spawn.
pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 0:
{
gTeam[playerid] = Grove;
SetPlayerPos(playerid,2520.2805,-1661.7422,14.4388);
SetPlayerCameraPos(playerid, 2518.0984,-1662.1184,14.2107);
SetPlayerCameraLookAt(playerid,2520.2805,-1661.7422,14.4388);
SetPlayerFacingAngle(playerid,94.8389);
GameTextForPlayer(playerid, "~y~Grove Street Families", 3000, 5);
}
case 1..2:
{
gTeam[playerid] = Seville;
SetPlayerPos(playerid,2765.3560,-2012.0973,13.5620);
SetPlayerCameraPos(playerid,2768.0066,-2012.0149,13.5547);
SetPlayerCameraLookAt(playerid,2765.3560,-2012.0973,13.5620);
SetPlayerFacingAngle(playerid,269.3739);
GameTextForPlayer(playerid, "~y~Seville Boulevard Families", 3000, 5);
}
case 3..5:
{
gTeam[playerid] = Temple;
SetPlayerPos(playerid,813.4062,-1105.5406,25.7874);
SetPlayerCameraPos(playerid,816.0425,-1105.4257,25.7906);
SetPlayerCameraLookAt(playerid,813.4062,-1105.5406,25.7874);
SetPlayerFacingAngle(playerid,272.4016);
GameTextForPlayer(playerid, "~y~Temple Drive Families", 3000, 5);
}
case 6:
{
gTeam[playerid] = Idlewood;
SetPlayerPos(playerid,2136.0479,-1682.3134,15.0859);
SetPlayerCameraPos(playerid,2138.6792,-1682.1892,15.0859);
SetPlayerCameraLookAt(playerid,2136.0479,-1682.3134,15.0859);
SetPlayerFacingAngle(playerid,276.5845);
GameTextForPlayer(playerid, "~y~Idlewood Ballas", 3000, 5);
}
case 7:
{
gTeam[playerid] = Jefferson;
SetPlayerPos(playerid,2217.0093,-1171.5662,25.7266);
SetPlayerCameraPos(playerid,2217.0027,-1168.8662,25.7266);
SetPlayerCameraLookAt(playerid,2217.0093,-1171.5662,25.7266);
SetPlayerFacingAngle(playerid,357.7867);
GameTextForPlayer(playerid, "~y~Jefferson Ballas", 3000, 5);
}
case 8:
{
gTeam[playerid] = Kilo;
SetPlayerPos(playerid,2058.1807,-1200.2612,23.9084);
SetPlayerCameraPos(playerid,2060.8184,-1200.3549,23.9090);
SetPlayerCameraLookAt(playerid,2058.1807,-1200.2612,23.9084);
SetPlayerFacingAngle(playerid,268.6248);
GameTextForPlayer(playerid, "~y~Kilo Tray Ballas", 3000, 5);
}
case 9:
{
gTeam[playerid] = Josh;
SetPlayerPos(playerid,2058.1807,-1200.2612,23.9084);
SetPlayerCameraPos(playerid,2060.8184,-1200.3549,23.9090);
SetPlayerCameraLookAt(playerid,2058.1807,-1200.2612,23.9084);
SetPlayerFacingAngle(playerid,268.6248);
GameTextForPlayer(playerid, "~r~[LSB]TheGame Only", 3000, 5);
}
}
return 1;
}
and the Case 9 is my skin but i dont know how to make that the player dies when he tryieng to take my skin, now when i choose a skin i die , with any skin
pawn Код:
public OnPlayerSpawn(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "[LSB]TheGame") == 0)
{
AddPlayerClass(21,1980.7158,-1231.5333,24.8155,98.0888,0,0,0,0,0,0);
}
if(strcmp(name, "[LSB]TheGame") == 1)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid,0xFF0019FF,"You are not [LSB]TheGame, press F4 and choose another Skin!");
}
return 1;
}
Re: Private Skin's Problem! -
Stigg - 17.10.2011
Try:
pawn Код:
new PlayerName[MAX_PLAYER_NAME];
Re: Private Skin's Problem! -
SmiT - 17.10.2011
EDIT: Stigg was faster, you also need to kill the player after you force him to class selection.
SetPlayerHealth( playerid, 0 );
AW: Private Skin's Problem! -
Santox14 - 17.10.2011
pawn Код:
public OnPlayerSpawn(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
new GetPlayerName(playerid,PlayerName, MAX_PLAYER_NAME);
if( GetPlayerSkin ( playerid ) == 21 )
{
if( !strcmp ( PlayerName, "[LSB]TheGame" ) )
{
SendClientMessage(playerid,0xFF0055FF, "Allowed to use this skin " );
}
else
{
ForceClassSelection(playerid);
SendClientMessage(playerid,0xFF0055FF,"You are not [LSB]TheGame, choose another Skin!" );
}
}
return true;
}
Error:
pawn Код:
C:\Users\Josh\Desktop\Mein Server\gamemodes\Josh.pwn(158) : warning 219: local variable "GetPlayerName" shadows a variable at a preceding level
C:\Users\Josh\Desktop\Mein Server\gamemodes\Josh.pwn(158) : error 001: expected token: ";", but found "("
C:\Users\Josh\Desktop\Mein Server\gamemodes\Josh.pwn(158) : warning 215: expression has no effect
C:\Users\Josh\Desktop\Mein Server\gamemodes\Josh.pwn(158) : warning 203: symbol is never used: "GetPlayerName"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
AW: Private Skin's Problem! -
Santox14 - 17.10.2011
how can i fix it?