Szerző Téma: Ajándék rendszerem hibás.  (Megtekintve 735 alkalommal)

Ajándék rendszerem hibás.
« Dátum: 2013. december 31. - 19:46:26 »
0 Show voters
Sziasztok!
Nemrég irtam egy ajándék scriptet...az ajándék dobozokat /felvesz parancsal lehet fel venni, és olyankor destroyt kap az ajándék doboz..
de ha az egyik már fel vette az ajándékot és oda megy egy másik is, és sintén be irja /felvesz akkor õ is meg kapja az ajádék dobozz tartalmát.
Na szoval nekem az kéne hogy ha már az egyik fel vette akkor a többiek ne birják már ott használni a parancsot.
 
#include 
#include
new ajandek1;
new ajandek2;
new ajandek3;
new ajandek4;
new ajandek5;
new ajandek6;
new ajandek7;
new ajandek8;
new ajandek9;
new ajandek10;
new ajandek11;
new ajandek12;
new ajandek13;
new ajandek14;
new ajandek15;
new ajandek16;
new ajandek17;
new ajandek18;
new ajandek19;
new ajandek20;
new ajandek21;
new ajandek22;
new ajandek23;
new ajandek24;
new ajandek25;
CMD:felvesz(playerid)
{
   if(IsPlayerInRangeOfPoint(playerid, 2.0, 2000.7106,1521.2894,17.0682))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek1);
ajandek2 = CreateObject(19055,2000.8641,1539.6223,13.5859-0.4,0,0,0);//2
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2000.8641,1539.6223,13.5859))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek2);
ajandek3 = CreateObject(19056,2034.3936,1545.0343,10.8203-0.4,0,0,0);//3
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2034.3936,1545.0343,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek3);
ajandek4 = CreateObject(19057,2057.4060,1569.3225,11.4699-0.4,0,0,0);//4
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2057.4060,1569.3225,11.4699))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek4);
ajandek5 = CreateObject(19058,2057.3882,1554.4794,11.4725-0.4,0,0,0);//5
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2057.3882,1554.4794,11.4725))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek5);
ajandek6 = CreateObject(19054,2102.6606,1522.4572,11.0609-0.4,0,0,0);//6
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2102.6606,1522.4572,11.0609))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek6);
ajandek7 = CreateObject(19055,2159.0486,1522.4441,11.0609-0.4,0,0,0);//7
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2159.0486,1522.4441,11.0609))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek7);
ajandek8 = CreateObject(19056,2210.8645,1522.4301,11.0609-0.4,0,0,0);//8
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2210.8645,1522.4301,11.0609))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek8);
ajandek9 = CreateObject(19057,2237.4045,1470.5760,11.0608-0.4,0,0,0);//9
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2237.4045,1470.5760,11.0608))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek9);
ajandek10 = CreateObject(19058,2219.0085,1427.1289,10.8203-0.4,0,0,0);//10
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2219.0085,1427.1289,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek10);
ajandek11 = CreateObject(19054,2183.2515,1427.2413,10.8203-0.4,0,0,0);//11
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2183.2515,1427.2413,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek11);
ajandek12 = CreateObject(19055,2184.0442,1389.5004,10.8203-0.4,0,0,0);//12
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2184.0442,1389.5004,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek12);
ajandek13 = CreateObject(19056,2215.9487,1389.2538,10.8203-0.4,0,0,0);//13
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2215.9487,1389.2538,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek13);
ajandek14 = CreateObject(19057,2239.6074,1383.9230,10.8203-0.4,0,0,0);//14
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2239.6074,1383.9230,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek14);
ajandek15 = CreateObject(19058,2270.6741,1353.2275,7.1641-0.4,0,0,0);//15
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2270.6741,1353.2275,7.1641))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek15);
ajandek16 = CreateObject(19054,2406.4670,1353.1459,7.1641-0.4,0,0,0);//16
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2407.3123,1287.4664,7.1641))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek16);
ajandek17 = CreateObject(19055,2407.3123,1287.4664,7.1641-0.4,0,0,0);//17
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2407.3123,1287.4664,7.1641))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek17);
ajandek18 = CreateObject(19056,2407.2617,1221.3405,7.1641-0.4,0,0,0);//18
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2407.2617,1221.3405,7.1641))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek18);
ajandek19 = CreateObject(19057,2407.5605,1193.1061,10.6719-0.4,0,0,0);//19
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2407.5605,1193.1061,10.6719))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek19);
ajandek20 = CreateObject(19058,2427.0042,1160.0642,10.6719-0.4,0,0,0);//20
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2427.0042,1160.0642,10.6719))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek20);
ajandek21 = CreateObject(19054,2474.4048,1159.5581,10.8203-0.4,0,0,0);//21
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2474.4048,1159.5581,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek21);
ajandek22 = CreateObject(19055,2474.8884,1124.2153,10.8203-0.4,0,0,0);//22
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2474.8884,1124.2153,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek22);
ajandek23 = CreateObject(19056,2516.7278,1122.9690,10.8203-0.4,0,0,0);//23
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2516.7278,1122.9690,10.8203))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek23);
ajandek24 = CreateObject(19057,2511.8477,1134.9968,14.2705-0.4,0,0,0);//24
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2511.8477,1134.9968,14.2705))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek24);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 2499.2087,1152.5796,25.3917))
   {
   SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
DestroyObject(ajandek25);
ajandek25 = CreateObject(19058,2499.2087,1152.5796,25.3917-0.4,0,0,0);//25
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
//vege
}
return 1;
}
CMD:eventkezdes(playerid)
{
   ajandek1 = CreateObject(19054,2000.7106,1521.2894,17.0682-0.4,0,0,0);//1
return 1;
}
« Utoljára szerkesztve: 2013. december 31. - 20:08:25 írta [SDW]BlackJack »

Ajándék rendszerem hibás.
« Válasz #1 Dátum: 2013. december 31. - 20:09:20 »
0 Show voters
Szia!
Én adnék neki egy boolean értéket vagy csak egy szám értéket minden egyes doboznak.
 
enum ajandekenum
{
ajandek1,
ajandek2
//Stb...
};
new ajandek[ajandekenum];
 
CMD:felvesz(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
{
    if(ajandek[ajandek1] == 1)
    {
        ajandek[ajandek1] =0;
        //Törlöd az objecteket stb..
}
}
//Kövi ajándék:
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
{
    if(ajandek[ajadek2] == 1)
    {
        ajandek[ajandek2] = 0;
        //Stb..
    }
}
//stb..
return 1;
}

Ajándék rendszerem hibás.
« Válasz #2 Dátum: 2013. december 31. - 20:18:32 »
0 Show voters
Hát ebbõl sokat nem értek..  :Cry2:

Dupla hozzászólás automatikusan összefûzve. ( 2014. január 01. - 16:45:01 )

Pls segitsetek! 7 -re készen kell egyek vele  :cry3:
« Utoljára szerkesztve: 2014. január 01. - 16:45:01 írta [SDW]BlackJack »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal