help me whit skins please!
#1

i want some skins only for adm but in time to compile have ths error:


Code:
Код:
C:\Users\Marcos\Documents\Server\gamemodes\SU.pwn(389) : error 017: undefined symbol "playerid"
the skins i want make only for adm:


Code:
Код:
if(IsPlayerLAdmin(playerid))
	AddPlayerClass(271,-467.6280,2208.3828,46.4052,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(270,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(266,-469.4590,2207.5110,46.5850,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(265,-470.4734,2207.0278,46.6846,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(272,-467.6280,2208.3828,46.4052,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(269,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(217,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(211,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(165,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(166,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(164,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(163,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(286,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(287,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
Please help me!
Reply
#2

Use OnPlayerRequestSpawn.
Reply
#3

Код:
C:\Users\Marcos\Documents\Server\gamemodes\SU.pwn(389) : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Users\Marcos\Documents\Server\gamemodes\SU.pwn(391) : error 017: undefined symbol "playerid"
Код:
OnPlayerRequestSpawn(playerid)
	{
	if(IsPlayerLAdmin(playerid))
	AddPlayerClass(271,-467.6280,2208.3828,46.4052,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(270,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(266,-469.4590,2207.5110,46.5850,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(265,-470.4734,2207.0278,46.6846,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(272,-467.6280,2208.3828,46.4052,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(269,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(217,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(211,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(165,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(166,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(164,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(163,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(286,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(287,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	}
is correct?
sorry for my bad english
Reply
#4

No, it's a callback.

Leave the classes for now. Lets say you want to have class 1 2 and 3 for admins, you do this:

pawn Код:
new pClass[MAX_PLAYERS]; // Top of script, outside of all publics etc.

public OnPlayerRequestSpawn(playerid)
{
  if(pClass[playerid] == 1 || pClass[playerid] == 2 || pClass[playerid] == 3)
  {
    if(!IsPlayerAdmin(playerid))
    {
      SendClientMessage(playerid, color, "This skin is for admins only!");
      return 0;
    }
  }
  return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
  pClass[playerid] = classid;
  return 1;
}
Reply
#5

Код:
public OnPlayerRequestSpawn(playerid)
{
  if(pClass[playerid] == 1 || pClass[playerid] == 2 || pClass[playerid] == 3)
  {
    if(IsPlayerAdmin(playerid))
    {
      SendClientMessage(playerid, color, "This skin is for admins only!");
      return 0;
    }
  }
  return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
  pClass[playerid] = classid;
  return 1;
}
	AddPlayerClass(271,-467.6280,2208.3828,46.4052,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(270,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(266,-469.4590,2207.5110,46.5850,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(265,-470.4734,2207.0278,46.6846,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(272,-467.6280,2208.3828,46.4052,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(269,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(217,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(211,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(165,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(166,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(164,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(163,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(286,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
	AddPlayerClass(287,-468.3654,2208.0317,46.4776,115.0000,4,1,31,10000,28,10000);
correct? i don' know too of scripts
Reply
#6

Don't put it under OnGameModeInit...

You should read pawn-lang.pdf and learn the basics before you try scripting.
Reply
#7

Ok thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)