if(!strcmp(cmdtext, "/cone", true)) { { if(gPlayerOnDuty[playerid] != 1) { SendClientMessage(playerid, COLOR_RED, "You need to be on duty."); return 1; } } if(ConeCounter == MAX_CONES) return SendClientMessage(playerid, COLOR_RED, "((Server Cone Limit Reached))"); if(ConePCounter == 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); Cone[ConeCounter++] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A+2); ConeP[ConePCounter++] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A+2); 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 <= ConeCounter; i++) DestroyObject(Cone[i]); ConePCounter = 4; return SendClientMessage(playerid, COLOR_GREEN, "You have picked your cones up."); } if(!strcmp(cmdtext, "/removeconesall", true)) { for(new i = 0; i <= ConeCounter; i++) DestroyObject(Cone[i]); ConeCounter = 100; ConePCounter = 100; return SendClientMessage(playerid, COLOR_GREEN, "*ADMIN*- You have removed all the cones."); } }
ConeConter++;
Cone[ConeCounter] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A+2);
ConeP[ConeCounter] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A+2);
Originally Posted by Daren_Jacobson
you are setting it to 4 and 100 when you should be putting it to 0
|
ConeConter++; Cone[ConeCounter] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A+2); ConeP[ConeCounter] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A+2); |
ConeConter++; Cone[ConeCounter] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A+2); |
ConeConter++; |
ConeConter[playerid]++; |
new ConeCounter; || new ConeCounter = 0; |
ConeConter[MAX_PLAYERS]++; |
#include <a_samp> #define MAX_CONES 100 #define MAX_PLAYER_CONES 4 new Cone[MAX_CONES]; new ConeP[MAX_PLAYER_CONES]; new ConeCounter[MAX_PLAYERS]; new ConePCounter[MAX_PLAYER_CONES]; //*************************************** CONE COMMANDS ***********************************// if(!strcmp(cmdtext, "/cone", true)) { if(ConeCounter == MAX_CONES) return SendClientMessage(playerid, COLOR_RED, "((Server Cone Limit Reached))"); if(ConePCounter == 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); ConeConter++; Cone[ConeCounter[MAX_PLAYERS]] = CreateObject(1238, X, Y, Z-2, 0.0, 0.0, A); Cone[ConePCounter] = CreateObject(1238, X, Y, Z-0.6, 0.0, 0.0, A); 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 <= ConeCounter; i++) DestroyObject(Cone[i]); ConePCounter = 4; return SendClientMessage(playerid, COLOR_GREEN, "You have picked your cones up."); } if(!strcmp(cmdtext, "/removeconesall", true)) { if(!hasPermission(playerid, ADMIN)) { return 1; } { for(new i = 0; i <= ConeCounter; i++) DestroyObject(Cone[i]); ConeCounter = 100; ConePCounter = 100; return SendClientMessage(playerid, COLOR_GREEN, "*ADMIN*- You have removed all the cones."); } }