15.03.2012, 17:53
pawn Код:
if(strcmp(cmd, "/createfwall", true) == 0)
{
new rand,loop,Float:pX,Float:pY,Float:pZ,str[70];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /createfwall [Loop Number]");
return 1;
}
else
{
if(loop < 1) return SendClientMessage(playerid,COLOR_GREY,"Loop number can't be 0 or lower than 0!");
GetPlayerPos(playerid,pX,pY,pZ);
pX = pX + 1.000000;//offset X
pZ = pZ - 0.800000;//offset Z
for(new i = 0; i < 16; i++)
{
if(i != 4 && i != 8 && i != 12) pX = pX + 4.00;
else
{
pX = pX - 12.00;
pY = pY + 4.00;
}
rand = random(20) + 25;
CreateFirework(FireworkCount,pX,pY,pZ,rand,loop);
FireworkCount ++;
}
format(str,sizeof(str),"There are %d fireworks total!",FireworkCount);
SendClientMessage(playerid,COLOR_WHITE,string);
}
return 1;
}
pawn Код:
Loop number can't be 0 or lower than 0!