How can I do?
#1

How can I make these two commands to do just those in the PD / FBI and NG?

Код:
//=================================[ LSPD GATES ]====================================================================
	if(strcmp(cmd, "/lspdop", true) == 0)
	{
	if(IsPlayerConnected(playerid))
	{
	MoveObject(lspdgate,1588.84, -1637.89, 7.18,2);
	SendClientMessage(playerid, COLOR_LIGHTRED, "Portile de la garaj s-au deschis");
	}
	return 1;
}
	if(strcmp(cmd, "/lspdcl", true) == 0)
	{
	if(IsPlayerConnected(playerid))
	{
	MoveObject(lspdgate,1588.84, -1637.89, 13.18,2);
	SendClientMessage(playerid, COLOR_GREEN, "Portile de la garaj s-au inchis");
	}
	return 1;
}
&&

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys==KEY_CROUCH )&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
{
SetObjectRot(bariera, 0, 0, 270);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bariera S-a Deschis");
SetTimer("closelsdgate",2000,0);
}
return 1;
}
forward closelsdgate();
public closelsdgate()
{
SetObjectRot(bariera, 0, 270, 270);
return 1;
}



Thanks
Reply
#2

Make Variables:

Put this on top of the script with the other new's
pawn Код:
new IsLspd[MAX_PLAYERS];
Put this anywhere in the script below "IsLspd[MAX_PLAYERS];" , if you already have "public OnPlayerConnect" then just take the code out.
pawn Код:
public OnPlayerConnect(playerid)
{
   IsLspd[playerid] = 0;
}
Put this anywhere in the script below "IsLspd[MAX_PLAYERS];" , if you already have "public OnPlayerSpawn" then just take the code out.
pawn Код:
public OnPlayerSpawn(playerid)
{
   if(GetPlayerSkin(playerid) == LSPD_SKIN || GetPlayerSkin(playerid) == LSPD_SKIN) // change LSPD_SKIN to the skin id's your using.
   {
       IsLspd[playerid] = 1;
   }
}
Use this anywhere you want.
pawn Код:
if(IsLspd[playerid])
{

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)