Need Help/ I'm stuck.
#7

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.

Код:
#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.");
    }
    }
Reply


Messages In This Thread
Need Help/ I'm stuck. - by wiZaK - 25.02.2009, 21:34
Re: Need Help/ I'm stuck. - by Daren_Jacobson - 25.02.2009, 21:36
Re: Need Help/ I'm stuck. - by Streetplaya - 25.02.2009, 21:38
Re: Need Help/ I'm stuck. - by wiZaK - 25.02.2009, 21:40
Re: Need Help/ I'm stuck. - by wiZaK - 25.02.2009, 21:43
Re: Need Help/ I'm stuck. - by JaYmE - 25.02.2009, 21:51
Re: Need Help/ I'm stuck. - by wiZaK - 25.02.2009, 22:13
Re: Need Help/ I'm stuck. - by wiZaK - 25.02.2009, 22:51
Re: Need Help/ I'm stuck. - by JaYmE - 25.02.2009, 23:23

Forum Jump:


Users browsing this thread: 2 Guest(s)