Need Help/ I'm stuck.
#1

The script work to the extent of placing the cones, but im trying to make a limit for each player to place 4 cones each, problem is that once a player has placed 4 cones, and he removes them, he cannot place anymore cones( It says "You have no more cones"), and others get the Server Cone Limit reached, I got the Server Cone limit of 100 and the Player Cone limit of 4. Is there a reset command that resets it for the player?, Ive asked for advise to a more experienced scripter but hes stuck aswell.

If i need a database for it to work, I do have one.

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