Uhmm Help Please :P, I Dont Understand this script : ( FS )
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
  new idx;
  new cmd[256];

  cmd = strtok(cmdtext, idx);

  if (strcmpex(cmd, "/valkyrie", true) == 0) {
    if (IsPlayerInAnyVehicle(playerid)) {
      SetVehiclePos(GetPlayerVehicleID(playerid), 983.4988, 2374.6072, 13.8203);
    }
    else {
      SetPlayerPos(playerid, 983.4988, 2374.6072, 10.8203);
      SetPlayerFacingAngle(playerid, 270.0);
    }
	  return 1;
	}
Must become so only Members from faction 3 ( The Army )
Can use this.
Anybody can give me updated code please ?
Reply
#2

Just check if they're in that faction/team.

Examples:
pawn Код:
// example for sa:mp's GetPlayerTeam function.
if(GetPlayerTeam(playerid) == _YOUR_TEAM_ID)
{
  // other code for the command.
}
pawn Код:
// example if you're using a custom variable which checks player's team.
if(gTeam[playerid] == _YOUR_TEAM_ID)
{
  // other code for the command.
}
And you don't need 256 cells, sa:mp's MAX IO is 128.
Reply
#3

Its army base for RP Server of me,
SO only the Army ( ID 3 ) Can use it :P
Reply
#4

I already gave you an example. I'm not sure which method you're using to check player's team.
Reply
#5

Код:
static gTeam[MAX_PLAYERS];
Maybe that helps :P!
Reply
#6

Others tell me code you need ( Begin of it ;P )
Reply
#7

He means: Factions: On roleplay gamemodes,
Like pFaction or pMember, Or whatever it is..
Reply
#8

Its defined with is[pLeader] & [pMember] :P!
Reply
#9

[pMember] == 3
(blablabla...)
[pLeader] == 3

Thats how its defined in my script
( I Use GTA RP )
Reply
#10

Then it's something like this:
pawn Код:
if(PlayerInfo[playerid][pMember] == _YOUR_TEAM_ID || PlayerInfo[playerid][pLeader] == _YOUR_TEAM_ID) // _YOUR_TEAM_ID should be 3 if you have Army faction defined as ID 3.
{
  // other code for the command.
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)