[POMOC] Bug kod komande

Započeo // xunder, Decembar 05, 2014, 20:55:58 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: UnderPoint editujem
Detaljan opis problema: Ubacio sam vatromet, jelke, snowmana pokretnog sa sa-mp.com i udjem IG i kucam npr. /adminduty i izbaci mi kao ono Komanda koju ste ukucali ne postoji a gore mi upise ono Admin %s je sada na duty i komanda radi. I sve komande tako
Dio skripte:
//------------------------------------------------------------------------------
//INFO YCMD: to create a Christmas tree.
YCMD:ajelka(playerid, params[], help)
{
    new Float:pos[4],data[100];
    if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 7) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Nemate autorizaciju za koriscenje komande"B"!.");
    //if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You can only use the function on Christmas Day"B"!.");
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Error"B"!.");
if(CountingTreeObjects>=MAX_TREE) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have already created too many Christmas trees"B"!.");
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    GetPlayerFacingAngle(playerid,pos[3]);
    pos[0] = pos[0] + (3.0 * floatsin(-pos[3], degrees));
    pos[1] = pos[1] + (3.0 * floatcos(-pos[3], degrees));
    CountingTreeObjects++;
TreeObjects[CountingTreeObjects][0] = CreateObject(19076, pos[0],pos[1],pos[2]-1.0,0.0,0.0,3000.0);
TreeObjects[CountingTreeObjects][1] = CreateObject(19054, pos[0],pos[1]+1.0, pos[2]-0.4,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][2] = CreateObject(19058, pos[0]+1.0, pos[1], pos[2]-0.4,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][3] = CreateObject(19056, pos[0], pos[1]-1.0, pos[2]-0.4,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][4] = CreateObject(19057, pos[0]-1.0, pos[1], pos[2]-0.4,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][5] = CreateObject(19058, pos[0]-1.5, pos[1]+1.5, pos[2]-1.0,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][6] = CreateObject(19055, pos[0]+1.5, pos[1]-1.5, pos[2]-1.0,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][7] = CreateObject(19057, pos[0]+1.5, pos[1]+1.5, pos[2]-1.0,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][8] = CreateObject(19054, pos[0]-1.5, pos[1]-1.5, pos[2]-1.0,0,0,0.0,3000.0);
TreeObjects[CountingTreeObjects][9] = CreateObject(3526, pos[0],pos[1],pos[2]-1.0,0,0,3000.0);
SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have created a Christmas tree successfully"B"!.");
format(data,sizeof(data),""B"[HW:RPG] "R"trees created: "B"[%02d/%02d]",CountingTreeObjects,MAX_TREE);
SendClientMessage(playerid,-1,data);
return true;
}
//------------------------------------------------------------------------------
//INFO YCMD: to remove a Christmas tree created, counting from the last one created.
YCMD:unistijelku(playerid, params[], help)
{
new data[100];
if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 7) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Nemate autorizaciju za koriscenje komande"B"!.");
//if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You can only use the function on Christmas Day"B"!.");
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Error"B"!.");
    if(CountingTreeObjects<=0) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have not created any Christmas tree"B"!.");
for(new slots=0,index=10;slots!=index;slots++) {DestroyObject(TreeObjects[CountingTreeObjects][slots]);}
CountingTreeObjects--;
SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have removed the last Christmas tree created"B"!.");
format(data,sizeof(data),""B"[HW:RPG] "R"trees created: "B"[%02d/%02d]",CountingTreeObjects,MAX_TREE);
SendClientMessage(playerid,-1,data);
return true;
}
//------------------------------------------------------------------------------
//INFO YCMD: to remove all Christmas trees created.
YCMD:unistisvejelke(playerid, params[], help)
{
new data[100];
if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 7) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Nemate autorizaciju za koriscenje komande"B"!.");
//if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You can only use the function on Christmas Day"B"!.");
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Error"B"!.");
    if(CountingTreeObjects<=0) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have not created any Christmas treed"B"!.");
for(new slots=0,idx=CountingTreeObjects+1;slots!=idx;slots++)
{
for(new object=0,index=10;object!=index;object++){DestroyObject(TreeObjects[slots][object]); CountingTreeObjects=0;}
}
SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have removed all Christmas trees created"B"!.");
format(data,sizeof(data),""B"[HW:RPG] "R"trees created: "B"[%02d/%02d]",CountingTreeObjects,MAX_TREE);
SendClientMessage(playerid,-1,data);
return true;
}
//------------------------------------------------------------------------------
//INFO YCMD: to turn the machine fireworks.
YCMD:vatromet(playerid, params[], help)
{
new Float:pos[3];
//if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You can only use the function on Christmas Day"B"!.");
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Error"B"!.");
if(DistanceBetweenMachineAndPlayer(playerid, 3.5))
{
if(!FireworksObjectsActivated[SaveFireworksObjects[playerid]])
{
FireworksObjectsActivated[SaveFireworksObjects[playerid]]=true;
for(new slots=1,index=10;slots!=index;slots++) {DestroyObject(FireworksObjects[SaveFireworksObjects[playerid]][slots]);}
GetObjectPos(FireworksObjects[SaveFireworksObjects[playerid]][0], pos[0], pos[1], pos[2]);
FireworksObjects[SaveFireworksObjects[playerid]][1] = CreateObject(ObjectsFireworks[1],pos[0],pos[1],pos[2]+0.5,0,0,0,0);
FireworksObjects[SaveFireworksObjects[playerid]][2] = CreateObject(ObjectsFireworks[random(4)],pos[0],pos[1],pos[2]+0.5,0,0,0,0);
FireworksObjects[SaveFireworksObjects[playerid]][3] = CreateObject(ObjectsFireworks[6],pos[0],pos[1],pos[2]+0.5,0,0,0,0);
MoveObject(FireworksObjects[SaveFireworksObjects[playerid]][2],pos[0],pos[1],pos[2]+30, 10.0);
MoveObject(FireworksObjects[SaveFireworksObjects[playerid]][3],pos[0],pos[1],pos[2]+30, 10.0);
SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Vatromet || UKLJUCEN || ODMAKNITE SE!"B"!.");
}
else
{
FireworksObjectsActivated[SaveFireworksObjects[playerid]]=false;
for(new slots=1,index=10;slots!=index;slots++) {DestroyObject(FireworksObjects[SaveFireworksObjects[playerid]][slots]);}
SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Iskljucili ste vatromet!"B"!.");
}
}
else{SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Niste kod masine za vatromet"B"!.");}
return true;
}
//------------------------------------------------------------------------------
stock DistanceBetweenMachineAndPlayer(playerid, Float:dist)
{
new Float:pos[3];
for(new slots=0,idx=CountingFireworksObjects+1;slots!=idx;slots++)
{
    GetObjectPos(FireworksObjects[slots][0], pos[0], pos[1], pos[2]);
if(IsPlayerInRangeOfPoint(playerid, dist, pos[0], pos[1], pos[2]))
return SaveFireworksObjects[playerid]=slots;
}
return false;
}
//------------------------------------------------------------------------------
forward UploaFireworks();
public UploaFireworks()
{
new Float:pos[3];
for(new slots=0,index=MAX_FIREWORKS;slots!=index;slots++)
{
if(FireworksObjectsActivated[slots]==true)
{
if(!IsObjectMoving(FireworksObjects[slots][2]))
{
GetObjectPos(FireworksObjects[slots][2], pos[0], pos[1], pos[2]);
    CreateExplosion(pos[0] + float(30 - (30 / 2)), pos[1], pos[2], 7, 10);
    CreateExplosion(pos[0], pos[1] + float(30 - (30 / 2)), pos[2], 7, 10);
    CreateExplosion(pos[0], pos[1], pos[2] + float(30 - (30 / 2)), 7, 10);
GetObjectPos(FireworksObjects[slots][0], pos[0], pos[1], pos[2]);
SetObjectPos(FireworksObjects[slots][2], pos[0], pos[1], pos[2]);
SetObjectPos(FireworksObjects[slots][3], pos[0], pos[1], pos[2]);
MoveObject(FireworksObjects[slots][2],pos[0],pos[1],pos[2]+30, 10.0);
MoveObject(FireworksObjects[slots][3],pos[0],pos[1],pos[2]+30, 10.0);
}
}
}
}
//------------------------------------------------------------------------------
//INFO YCMD: to place the base of the fireworks.
YCMD:kreirajvatromet(playerid, params[], help)
{
    new Float:pos[4],data[100];
    if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 7) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Nemate autorizaciju za koriscenje komande"B"!.");
//if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You can only use the function on Christmas Day"B"!.");
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Error"B"!.");
if(CountingFireworksObjects>=MAX_FIREWORKS) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have already created too many machines fireworks"B"!.");
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    GetPlayerFacingAngle(playerid,pos[3]);
    pos[0] = pos[0] + (3.0 * floatsin(-pos[3], degrees));
    pos[1] = pos[1] + (3.0 * floatcos(-pos[3], degrees));
    if(CountingFireworksObjects==0){KillTimer(KillUploaFireworks),KillUploaFireworks=SetTimer("UploaFireworks",2*1000,true);}
CountingFireworksObjects++;
FireworksObjects[CountingFireworksObjects][0] = CreateObject(ObjectsFireworks[5], pos[0],pos[1],pos[2]-1.5,0,0,pos[3],3000.0);
SetObjectMaterial(FireworksObjects[CountingFireworksObjects][0], 1, 18848, "milbase", "ws_oldpainted", -1);
SetObjectMaterial(FireworksObjects[CountingFireworksObjects][0], 4, 18848, "milbase", "ws_oldpainted", -1);
SetObjectMaterial(FireworksObjects[CountingFireworksObjects][0], 5, 18848, "milbase", "ws_oldpainted", -1);
SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have created artificial machine fires successfully"B"!.");
format(data,sizeof(data),""B"[HW:RPG] "R"machine created fireworks: "B"[%02d/%02d]",CountingFireworksObjects,MAX_FIREWORKS);
SendClientMessage(playerid,-1,data);
return true;
}
//------------------------------------------------------------------------------
//INFO YCMD: to remove created fireworks machines, counting from the most recently created.
YCMD:unistivatromet(playerid, params[], help)
{
    new data[100];
    if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 7) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Nemate autorizaciju za koriscenje komande"B"!.");
//if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You can only use the function on Christmas Day"B"!.");
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Error"B"!.");
if(CountingFireworksObjects<=0) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have not created any machine fireworks"B"!.");
for(new slots=0,index=10;slots!=index;slots++) {DestroyObject(FireworksObjects[CountingFireworksObjects][slots]);}
    FireworksObjectsActivated[CountingFireworksObjects]=false;
CountingFireworksObjects--;
    SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have removed the last machine fireworks created successfully"B"!.");
format(data,sizeof(data),""B"[HW:RPG] "R"machine created fireworks: "B"[%02d/%02d]",CountingFireworksObjects,MAX_FIREWORKS);
SendClientMessage(playerid,-1,data);
return true;
}
//------------------------------------------------------------------------------
//INFO YCMD: to eliminate all machines created fireworks.
YCMD:unistisvevatromete(playerid, params[], help)
{
    new data[100];
    if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 7) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Nemate autorizaciju za koriscenje komande"B"!.");
//if(!IsChristmasDay()) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You can only use the function on Christmas Day"B"!.");
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"Error"B"!.");
if(CountingFireworksObjects<=0) return SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You have not created any machine fireworks"B"!.");
for(new slots=0,idx=CountingFireworksObjects+1;slots!=idx;slots++){
FireworksObjectsActivated[slots]=false;
for(new object=0,index=10;object!=index;object++){DestroyObject(FireworksObjects[slots][object]); CountingFireworksObjects=0;} }
    KillTimer(KillUploaFireworks);
SendClientMessage(playerid,-1,""B"[HW:RPG] "R"You've eliminated all machines fireworks created successfully"B"!.");
format(data,sizeof(data),""B"[HW:RPG] "R"machine created fireworks: "B"[%02d/%02d]",CountingFireworksObjects,MAX_FIREWORKS);
SendClientMessage(playerid,-1,data);
return true;
}
//------------------------------------------------------------------------------
YCMD:snowman(playerid, params[], help)
{
if ( pLogo[ playerid ] == true )
{
pLogo[ playerid ] = false ;

#if defined V03c
SendClientMessage( playerid, -1, ""#COL_EASY"The snowman has been hidden! {FFFFFF}["#COL_RED"DISABLED{FFFFFF}]");
SendClientMessage( playerid, -1, ""#COL_EASY"Write again "#COL_BLUE"/snowman"#COL_EASY" to activate it!");

#else

SendClientMessage( playerid, -1, "The logo has been hidden! [DISABLED]");
SendClientMessage( playerid, -1, "Write again /snowman to activate it!");

#endif

HideLogo(  playerid  );
}
else
{
pLogo[ playerid ] = true ;

#if defined V03c
SendClientMessage( playerid, -1, ""#COL_EASY"The logo is displayed on the screen! {FFFFFF}["#COL_GREEN"ENABLED{FFFFFF}]");
SendClientMessage( playerid, -1, ""#COL_EASY"Write again "#COL_BLUE"/snowman"#COL_EASY" to de-activate it!");

#else

SendClientMessage( playerid, -1, "The logo is displayed on the screen! [ENABLED]");
SendClientMessage( playerid, -1, "Write again /snowman to de-activate it!");

#endif
ShowLogo(  playerid  );
}
return true;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /--/

Pogledaj da nemas mozda u nekoj FS istu komandu



Pa imas dosta FS ne bih trebalo da bude tako probaj ako ne javi ovde pa cu ti pomoc

i am king!