25.02.2009, 21:34
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 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.");
}
}


not 8