01.02.2010, 16:12
Hey guys, I made a jail cmd.
But it doesn't really work you know. I want that it only works if the other play id is this color: 0xFF8000FF (It is orange).
It is working btw. But I just want that it only works if the other player id is orange.
my script:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/jail", cmdtext, true, 10) == 0)
{
new Float:X, Float:Y, Float:Z; //We define floats for the player coordinates
if(GetPlayerColor(playerid) == 0x2641FEAA)
GetPlayerPos(playerid, X, Y, Z); //check what the play coords are.
for(new i = 0; i < MAX_PLAYERS; i++) //This is a 'for' loop, first we define variable 'i' with value of 0, then we check if 'i' is less than the maximum players and if it is, the loop gets run and i gets incremented.
{
if(Jailed[i] == 1)
{
return 1;
}
if(PlayerToPoint(3, i, X, Y, Z) && i != playerid) //Check if the player is near the other
{
SetPlayerPos(i, 263.7086,81.9716,1001.0391);//Set the player position to the jail one. change JailX, etc with the jail coords.
SetPlayerInterior(i, 6); //Set the jailinterior to the jail interior your using.
SetTimerEx("JailTimer", 180000, 0, "i", i);
}
}
return 1;
}
public JailTimer(playerid)
{
if(GetPlayerColor(playerid) == 0xAA3333AA)
Jailed[playerid] = 0;
SetPlayerPos(playerid, 1543.9264,-1675.6503,13.5574); //Set the coords to the ones you want.
return 1;
}
Regards
But it doesn't really work you know. I want that it only works if the other play id is this color: 0xFF8000FF (It is orange).
It is working btw. But I just want that it only works if the other player id is orange.
my script:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/jail", cmdtext, true, 10) == 0)
{
new Float:X, Float:Y, Float:Z; //We define floats for the player coordinates
if(GetPlayerColor(playerid) == 0x2641FEAA)
GetPlayerPos(playerid, X, Y, Z); //check what the play coords are.
for(new i = 0; i < MAX_PLAYERS; i++) //This is a 'for' loop, first we define variable 'i' with value of 0, then we check if 'i' is less than the maximum players and if it is, the loop gets run and i gets incremented.
{
if(Jailed[i] == 1)
{
return 1;
}
if(PlayerToPoint(3, i, X, Y, Z) && i != playerid) //Check if the player is near the other
{
SetPlayerPos(i, 263.7086,81.9716,1001.0391);//Set the player position to the jail one. change JailX, etc with the jail coords.
SetPlayerInterior(i, 6); //Set the jailinterior to the jail interior your using.
SetTimerEx("JailTimer", 180000, 0, "i", i);
}
}
return 1;
}
public JailTimer(playerid)
{
if(GetPlayerColor(playerid) == 0xAA3333AA)
Jailed[playerid] = 0;
SetPlayerPos(playerid, 1543.9264,-1675.6503,13.5574); //Set the coords to the ones you want.
return 1;
}
Regards