09.04.2012, 23:06
Before you add this, how does this work? what you did is, looping through all available DropInfo, and whatever were add no positions, you create an object. I think it does that a few times, ehm...
pawn Код:
if(!strcmp(cmd, "/pmats", true) || !strcmp(cmd, "/posermateriels", true)) // By FreshKilla
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pmats [montant]");
}
if(!PlayerInfo[playerid][pMats])
{
return SendClientMessage(playerid, COLOR_GREY, " Vous n'avez pas des mate'riaux d'abandonner ! ");
}
if(strval(tmp) > PlayerInfo[playerid][pMats])
{
return SendClientMessage(playerid, COLOR_GREY, " Vous n'avez pas suffisament de mate'riaux.");
}
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pMats] -= strval(tmp);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
format(string, sizeof(string), "* %s laisse tomber ses Matos a` terre.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
for(new i; i < sizeof(DropInfo); i++)
{
if(DropInfo[i][dx] != 0.0 && DropInfo[i][dy] != 0.0 && DropInfo[i][dz] != 0.0)
{
continue;
}
new
Float:X,
Float:Y,
Float:Z
;
GetPlayerPos(playerid, X, Y, Z);
DropInfo[i][dType] = 3;
DropInfo[i][dAmount][0] = stash;
DropInfo[i][dx] = X;
DropInfo[i][dy] = Y;
DropInfo[i][dz] = Z;
DropInfo[i][dWorld] = GetPlayerVirtualWorld(playerid);
strcpy(DropInfo[i][dPlayerName],tmp,MAX_PLAYER_NAME);
DropObject[i] = CreateDynamicObject(2060, X, Y, Z-1, 0, 0, 0, GetPlayerVirtualWorld(playerid));
break;
}
return 1;
}

