SA-MP Forums Archive
Uhmm Help Please :P, I Dont Understand this script : ( FS ) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Uhmm Help Please :P, I Dont Understand this script : ( FS ) (/showthread.php?tid=125525)



Uhmm Help Please :P, I Dont Understand this script : ( FS ) - SamAlexSam - 04.02.2010

Код:
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 ?


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - Correlli - 04.02.2010

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.


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - SamAlexSam - 04.02.2010

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


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - Correlli - 04.02.2010

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


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - SamAlexSam - 04.02.2010

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


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - SamAlexSam - 04.02.2010

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


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - Torran - 04.02.2010

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


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - SamAlexSam - 04.02.2010

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


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - SamAlexSam - 04.02.2010

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

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


Re: Uhmm Help Please :P, I Dont Understand this script : ( FS ) - Correlli - 04.02.2010

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.
}