08.07.2009, 05:30
I've been trying to learn how to script and I'm trying to implement scripts on this forum to see what they do and to see how they worked.
I've been trying to get a cone script I found here to work with The GF script...
I get a warning and for some reason now the /login and /register cmds say that they are unknown cmds
I've been trying to get a cone script I found here to work with The GF script...
Quote:
//---------------------------<[ 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; |
Quote:
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. |