25.02.2009, 22:13
Im making the player create 2 cones to limit the objects for the server, so that once MAX CONES reaches 100 no more cones will be allowed to be created, and an admin will have to remove the cones. I extracted everything in the script that has to do with the cones.
I made some of the changes you told, but I lost you at the later onces you told me to change.
I made some of the changes you told, but I lost you at the later onces you told me to change.
Код:
#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."); } }