//---------------------------<[ OnPlayerCommandText ]>-------------------------------------------------------- new AmmountOfCones; enum PlayerCones { Cone1, Cone2, Cone3, Cone4, Cones } new PlayerConeCounter[MAX_PLAYERS][PlayerCones]; public OnPlayerCommandText(playerid, cmdtext[]) { if ( !strcmp(cmdtext, "/Cone", true) ) { if ( AmmountOfCones == MAX_CONES ) return SendClientMessage(playerid, COLOR_RED, "((Server Cone Limit Reached))"); if ( PlayerConeCounter[playerid][Cones] == MAX_PLAYER_CONES ) return SendClientMessage(playerid, COLOR_RED, "You have no more cones"); new Float:X, Float:Y, Float:Z, Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); if ( PlayerConeCounter[playerid][Cone1] == 0 ) { PlayerConeCounter[playerid][Cone1] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A); AmmountOfCones++; PlayerConeCounter[playerid][Cones] += 1; } else { if ( PlayerConeCounter[playerid][Cone2] == 0 ) { PlayerConeCounter[playerid][Cone2] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A); AmmountOfCones++; PlayerConeCounter[playerid][Cones] += 1; } else { if ( PlayerConeCounter[playerid][Cone3] == 0 ) { PlayerConeCounter[playerid][Cone3] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A); AmmountOfCones++; PlayerConeCounter[playerid][Cones] += 1; } else { if ( PlayerConeCounter[playerid][Cone4] == 0 ) { PlayerConeCounter[playerid][Cone4] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A); AmmountOfCones++; PlayerConeCounter[playerid][Cones] += 1; } } } } SetPlayerPos(playerid, X, Y, Z); return SendClientMessage(playerid, COLOR_GREEN, "You have placed a cone."); } if ( !strcmp(cmdtext, "/RemoveCones", true) ) { for ( new i = 0; i <= PlayerConeCounter[playerid][Cones]; i++ ) { if ( PlayerConeCounter[playerid][Cones] == 1 ) { DestroyObject(PlayerConeCounter[playerid][Cone1]); AmmountOfCones -= 1; } else if ( PlayerConeCounter[playerid][Cones] == 2 ) { DestroyObject(PlayerConeCounter[playerid][Cone1]); DestroyObject(PlayerConeCounter[playerid][Cone2]); AmmountOfCones -= 2; } else if ( PlayerConeCounter[playerid][Cones] == 3 ) { DestroyObject(PlayerConeCounter[playerid][Cone1]); DestroyObject(PlayerConeCounter[playerid][Cone2]); DestroyObject(PlayerConeCounter[playerid][Cone3]); AmmountOfCones -= 3; } else if ( PlayerConeCounter[playerid][Cones] == 4 ) { DestroyObject(PlayerConeCounter[playerid][Cone1]); DestroyObject(PlayerConeCounter[playerid][Cone2]); DestroyObject(PlayerConeCounter[playerid][Cone3]); DestroyObject(PlayerConeCounter[playerid][Cone4]); AmmountOfCones -= 4; } PlayerConeCounter[playerid][Cone1] = 0; PlayerConeCounter[playerid][Cone2] = 0; PlayerConeCounter[playerid][Cone3] = 0; PlayerConeCounter[playerid][Cone4] = 0; PlayerConeCounter[playerid][Cones] = 0; } return SendClientMessage(playerid, COLOR_GREEN, "You have picked your cones up."); } if ( !strcmp(cmdtext, "/RemoveConesAll", true) ) { if ( IsPlayerAdmin(playerid) ) { for ( new i = 0; i <= MAX_PLAYERS; i++ ) { DestroyObject(PlayerConeCounter[playerid][Cone1]); DestroyObject(PlayerConeCounter[playerid][Cone2]); DestroyObject(PlayerConeCounter[playerid][Cone3]); DestroyObject(PlayerConeCounter[playerid][Cone4]); PlayerConeCounter[playerid][Cone1] = 0; PlayerConeCounter[playerid][Cone2] = 0; PlayerConeCounter[playerid][Cone3] = 0; PlayerConeCounter[playerid][Cone4] = 0; PlayerConeCounter[playerid][Cones] = 0; AmmountOfCones = 0; } return SendClientMessage(playerid, COLOR_GREEN, "*ADMIN*- You have removed all the cones."); } } new string[256]; new playermoney; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; new cmd[256]; new tmp[256]; new giveplayerid, moneys, idx; cmd = strtok(cmdtext, idx); return 0; |
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\gf.pwn(822 : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Header size: 5984 bytes Code size: 1104696 bytes Data size: 2193772 bytes Stack/heap size: 16384 bytes; estimated max. usage=4904 cells (19616 bytes) Total requirements: 3320836 bytes 1 Warning. |
//---------------------------<[ OnPlayerCommandText ]>--------------------------------------------------------
new AmmountOfCones;
enum PlayerCones {
Cone1,
Cone2,
Cone3,
Cone4,
Cones
}
new PlayerConeCounter[MAX_PLAYERS][PlayerCones];
public OnPlayerCommandText(playerid, cmdtext[]) {
if ( !strcmp(cmdtext, "/Cone", true) ) {
if ( AmmountOfCones == MAX_CONES ) return SendClientMessage(playerid, COLOR_RED, "((Server Cone Limit Reached))");
if ( PlayerConeCounter[playerid][Cones] == MAX_PLAYER_CONES ) return SendClientMessage(playerid, COLOR_RED, "You have no more cones");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if ( PlayerConeCounter[playerid][Cone1] == 0 ) {
PlayerConeCounter[playerid][Cone1] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A);
AmmountOfCones++;
PlayerConeCounter[playerid][Cones] += 1;
} else {
if ( PlayerConeCounter[playerid][Cone2] == 0 ) {
PlayerConeCounter[playerid][Cone2] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A);
AmmountOfCones++;
PlayerConeCounter[playerid][Cones] += 1;
} else {
if ( PlayerConeCounter[playerid][Cone3] == 0 ) {
PlayerConeCounter[playerid][Cone3] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A);
AmmountOfCones++;
PlayerConeCounter[playerid][Cones] += 1;
} else {
if ( PlayerConeCounter[playerid][Cone4] == 0 ) {
PlayerConeCounter[playerid][Cone4] = CreateObject(1238, X, Y, Z-0.7, 0.0, 0.0, A);
AmmountOfCones++;
PlayerConeCounter[playerid][Cones] += 1;
}
}
}
}
SetPlayerPos(playerid, X, Y, Z);
return SendClientMessage(playerid, COLOR_GREEN, "You have placed a cone.");
}
if ( !strcmp(cmdtext, "/RemoveCones", true) ) {
for ( new i = 0; i <= PlayerConeCounter[playerid][Cones]; i++ ) {
if ( PlayerConeCounter[playerid][Cones] == 1 ) {
DestroyObject(PlayerConeCounter[playerid][Cone1]);
AmmountOfCones -= 1;
} else if ( PlayerConeCounter[playerid][Cones] == 2 ) {
DestroyObject(PlayerConeCounter[playerid][Cone1]);
DestroyObject(PlayerConeCounter[playerid][Cone2]);
AmmountOfCones -= 2;
} else if ( PlayerConeCounter[playerid][Cones] == 3 ) {
DestroyObject(PlayerConeCounter[playerid][Cone1]);
DestroyObject(PlayerConeCounter[playerid][Cone2]);
DestroyObject(PlayerConeCounter[playerid][Cone3]);
AmmountOfCones -= 3;
} else if ( PlayerConeCounter[playerid][Cones] == 4 ) {
DestroyObject(PlayerConeCounter[playerid][Cone1]);
DestroyObject(PlayerConeCounter[playerid][Cone2]);
DestroyObject(PlayerConeCounter[playerid][Cone3]);
DestroyObject(PlayerConeCounter[playerid][Cone4]);
AmmountOfCones -= 4;
}
PlayerConeCounter[playerid][Cone1] = 0;
PlayerConeCounter[playerid][Cone2] = 0;
PlayerConeCounter[playerid][Cone3] = 0;
PlayerConeCounter[playerid][Cone4] = 0;
PlayerConeCounter[playerid][Cones] = 0;
}
return SendClientMessage(playerid, COLOR_GREEN, "You have picked your cones up.");
}
if ( !strcmp(cmdtext, "/RemoveConesAll", true) ) {
if ( IsPlayerAdmin(playerid) ) {
for ( new i = 0; i <= MAX_PLAYERS; i++ ) {
DestroyObject(PlayerConeCounter[playerid][Cone1]);
DestroyObject(PlayerConeCounter[playerid][Cone2]);
DestroyObject(PlayerConeCounter[playerid][Cone3]);
DestroyObject(PlayerConeCounter[playerid][Cone4]);
PlayerConeCounter[playerid][Cone1] = 0;
PlayerConeCounter[playerid][Cone2] = 0;
PlayerConeCounter[playerid][Cone3] = 0;
PlayerConeCounter[playerid][Cone4] = 0;
PlayerConeCounter[playerid][Cones] = 0;
AmmountOfCones = 0;
}
return SendClientMessage(playerid, COLOR_GREEN, "*ADMIN*- You have removed all the cones.");
}
}
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
OnPlayerCommandText(playerid, cmdtext[]){ new string[256] new playermoney; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; new cmd[256]; new tmp[256]; new giveplayerid, moneys, idx; cmd = strtok(cmdtext, idx);
return 1;}
Originally Posted by Ace_Steele
THANKS !!
That worked, now while I have you here... I want to put an icon object in front of an interior, I've been looking and people are saying to use..... objectid = CreateObject( 2587, 2001.195679, 1547.113892, 14.283400, 0, 0, 96 ); I found that in the wiki for sa-mp, Would I just put in the object id for the icon I want and the co-ords ? Would I be able to just place that anywhere in the script ? Also to get the right co-ords would I use /save ? |
Originally Posted by troy52192
|