Hallo Community,
ich habe das Problem das ich mir ein Einarmiger Bandit Script gescriptet habe, aber es nicht klappen will.
Er zeigt mir anstatt die Bilder nur den Namen der Bilder also z.b. "LD_SLOT:berry" oder so an...
new bool:OAB_ON[MAX_PLAYERS];
new PlayerText:OAB_TD_1[MAX_PLAYERS];
new PlayerText:OAB_TD_2[MAX_PLAYERS];
new PlayerText:OAB_TD_3[MAX_PLAYERS];
new PlayerText:OAB_TD_4[MAX_PLAYERS];
new PlayerText:OAB_TD_5[MAX_PLAYERS];
new PlayerText:OAB_TD_6[MAX_PLAYERS];
new PlayerText:OAB_TD_7[MAX_PLAYERS];
new PlayerText:OAB_TD_8[MAX_PLAYERS];
new PlayerText:OAB_TD_9[MAX_PLAYERS];
new OAB_TD_1_SLOT[MAX_PLAYERS];
new OAB_TD_2_SLOT[MAX_PLAYERS];
new OAB_TD_3_SLOT[MAX_PLAYERS];
new OAB_TD_4_SLOT[MAX_PLAYERS];
new OAB_TD_5_SLOT[MAX_PLAYERS];
new OAB_TD_6_SLOT[MAX_PLAYERS];
new OAB_TD_7_SLOT[MAX_PLAYERS];
new OAB_TD_8_SLOT[MAX_PLAYERS];
new OAB_TD_9_SLOT[MAX_PLAYERS];
new OAB_TICKS[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
OAB_TD_1[playerid] = CreatePlayerTextDraw(playerid,274,247,"LD_SLOT:r_69");
OAB_TD_2[playerid] = CreatePlayerTextDraw(playerid,200,247,"LD_SLOT:r_69");
OAB_TD_3[playerid] = CreatePlayerTextDraw(playerid,348,247,"LD_SLOT:r_69");
OAB_TD_4[playerid] = CreatePlayerTextDraw(playerid,274,300,"LD_SLOT:r_69");
OAB_TD_5[playerid] = CreatePlayerTextDraw(playerid,200,300,"LD_SLOT:r_69");
OAB_TD_6[playerid] = CreatePlayerTextDraw(playerid,348,300,"LD_SLOT:r_69");
OAB_TD_7[playerid] = CreatePlayerTextDraw(playerid,274,353,"LD_SLOT:r_69");
OAB_TD_8[playerid] = CreatePlayerTextDraw(playerid,200,353,"LD_SLOT:r_69");
OAB_TD_9[playerid] = CreatePlayerTextDraw(playerid,348,353,"LD_SLOT:r_69");
...
forward OneArmedBanditTick(playerid);
public OneArmedBanditTick(playerid)
{
new timertime;
OAB_TD_1_SLOT[playerid]=VarRandom(1,6);
OAB_TD_2_SLOT[playerid]=VarRandom(1,6);
OAB_TD_3_SLOT[playerid]=VarRandom(1,6);
OAB_TD_4_SLOT[playerid]=VarRandom(1,6);
OAB_TD_5_SLOT[playerid]=VarRandom(1,6);
OAB_TD_6_SLOT[playerid]=VarRandom(1,6);
OAB_TD_7_SLOT[playerid]=VarRandom(1,6);
OAB_TD_8_SLOT[playerid]=VarRandom(1,6);
OAB_TD_9_SLOT[playerid]=VarRandom(1,6);
PlayerTextDrawSetString(playerid,OAB_TD_1[playerid],OABGetTDText(OAB_TD_1_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_2[playerid],OABGetTDText(OAB_TD_2_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_3[playerid],OABGetTDText(OAB_TD_3_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_4[playerid],OABGetTDText(OAB_TD_4_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_5[playerid],OABGetTDText(OAB_TD_5_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_6[playerid],OABGetTDText(OAB_TD_6_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_7[playerid],OABGetTDText(OAB_TD_7_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_8[playerid],OABGetTDText(OAB_TD_8_SLOT[playerid]));
PlayerTextDrawSetString(playerid,OAB_TD_9[playerid],OABGetTDText(OAB_TD_9_SLOT[playerid]));
switch (OAB_TICKS[playerid])
{
case 50..100:{timertime=50;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 40..49:{timertime=75;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 30..39:{timertime=100;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 20..29:{timertime=120;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 10..19:{timertime=150;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 9:{timertime=160;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 8:{timertime=170;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 7:{timertime=180;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 6:{timertime=190;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 5:{timertime=200;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 4:{timertime=210;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 3:{timertime=230;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 2:{timertime=260;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 1:{timertime=300;OAB_TICKS[playerid]--;SetTimerEx("OneArmedBanditTick",timertime,false,"u",playerid);}
case 0:{OAB_FINAL(playerid);}
}
return 1;
}
forward OAB_END(playerid);
public OAB_END(playerid)
{
PlayerTextDrawHide(playerid,OAB_TD_1[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_2[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_3[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_4[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_5[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_6[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_7[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_8[playerid]);
PlayerTextDrawHide(playerid,OAB_TD_9[playerid]);
OAB_ON[playerid]=false;
TogglePlayerControllable(playerid,1);
return 1;
}
stock OAB_WIN_ART(playerid)
{
if(OAB_TD_1_SLOT[playerid]==OAB_TD_2_SLOT[playerid] && OAB_TD_1_SLOT[playerid]==OAB_TD_3_SLOT[playerid] && OAB_TD_2_SLOT[playerid]==OAB_TD_3_SLOT[playerid])
{
if(OAB_TD_4_SLOT[playerid]==OAB_TD_5_SLOT[playerid] && OAB_TD_4_SLOT[playerid]==OAB_TD_6_SLOT[playerid] && OAB_TD_5_SLOT[playerid]==OAB_TD_6_SLOT[playerid])
{
if(OAB_TD_7_SLOT[playerid]==OAB_TD_8_SLOT[playerid] && OAB_TD_7_SLOT[playerid]==OAB_TD_9_SLOT[playerid] && OAB_TD_8_SLOT[playerid]==OAB_TD_9_SLOT[playerid])
{
return 3;
}
else
{
return 2;
}
}
else
{
return 1;
}
}
else if(OAB_TD_4_SLOT[playerid]==OAB_TD_5_SLOT[playerid] && OAB_TD_4_SLOT[playerid]==OAB_TD_6_SLOT[playerid] && OAB_TD_5_SLOT[playerid]==OAB_TD_6_SLOT[playerid])
{
if(OAB_TD_7_SLOT[playerid]==OAB_TD_8_SLOT[playerid] && OAB_TD_7_SLOT[playerid]==OAB_TD_9_SLOT[playerid] && OAB_TD_8_SLOT[playerid]==OAB_TD_9_SLOT[playerid])
{
return 2;
}
else
{
return 1;
}
}
else if(OAB_TD_7_SLOT[playerid]==OAB_TD_8_SLOT[playerid] && OAB_TD_7_SLOT[playerid]==OAB_TD_9_SLOT[playerid] && OAB_TD_8_SLOT[playerid]==OAB_TD_9_SLOT[playerid])
{
return 1;
}
else if(OAB_TD_1_SLOT[playerid]==OAB_TD_5_SLOT[playerid] && OAB_TD_1_SLOT[playerid]==OAB_TD_9_SLOT[playerid] && OAB_TD_5_SLOT[playerid]==OAB_TD_9_SLOT[playerid])
{
return 1;
}
return 0;
}
stock OneArmedBanditStart(playerid)
{
if(OAB_ON[playerid]==true)return SendClientMessage(playerid,ROT,"Du kannst nicht spielen während ein Spiel läuft.");
TogglePlayerControllable(playerid,0);
OAB_ON[playerid]=true;
OAB_TICKS[playerid]=100;
PlayerTextDrawColor(playerid,OAB_TD_1[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_2[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_3[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_4[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_5[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_6[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_7[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_8[playerid],0xFFFFFFFF);
PlayerTextDrawColor(playerid,OAB_TD_9[playerid],0xFFFFFFFF);
PlayerTextDrawTextSize(playerid,OAB_TD_1[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_2[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_3[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_4[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_5[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_6[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_7[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_8[playerid],75,75);
PlayerTextDrawTextSize(playerid,OAB_TD_9[playerid],75,75);
PlayerTextDrawShow(playerid,OAB_TD_1[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_2[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_3[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_4[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_5[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_6[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_7[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_8[playerid]);
PlayerTextDrawShow(playerid,OAB_TD_9[playerid]);
SetTimerEx("OneArmedBanditTick",10,false,"u",playerid);
return 1;
}
stock OAB_FINAL(playerid)
{
new menge,string[250];
if(OAB_WIN_ART(playerid) > 0)
{
menge = OAB_WIN_ART(playerid);
switch(OAB_TD_1_SLOT[playerid])
{
case 1:{format(string,sizeof(string),"~n~~r~!!!VEGAS!!!~n~~g~%d$",10000*menge);GameTextForPlayer(playerid,string,10000,6);GivePlayerCash(playerid,10000*menge);SendClientMessage(playerid,GRÜN,"Du bist in Vegas!!! Du hast 10.000$ gewonnen!!!");}
case 2:{format(string,sizeof(string),"~n~~r~!!!Gewonnen!!!~n~~g~%d$",5000*menge);GameTextForPlayer(playerid,string,10000,6);GivePlayerCash(playerid,5000*menge);SendClientMessage(playerid,GRÜN,"Du hast Gewonnen!!! Du hast 1.000$ gewonnen!!!");}
case 3:{format(string,sizeof(string),"~n~~r~!!!Gewonnen!!!~n~~g~%d$",1000*menge);GameTextForPlayer(playerid,string,10000,6);GivePlayerCash(playerid,1000*menge);SendClientMessage(playerid,GRÜN,"Du hast Gewonnen!!! Du hast 1.000$ gewonnen!!!");}
case 4:{format(string,sizeof(string),"~n~~r~!!!GOLDGLOCKE!!!~n~~g~%d$",50000*menge);GameTextForPlayer(playerid,string,10000,6);GivePlayerCash(playerid,50000*menge);SendClientMessage(playerid,GRÜN,"Hörst du die Goldglocken? Du hast 50.000$ gewonnen!!!");}
case 5:{format(string,sizeof(string),"~n~~r~!!!JACKPOT!!!~n~~g~%d$",500000*menge);GameTextForPlayer(playerid,string,10000,6);GivePlayerCash(playerid,500000*menge);SendClientMessage(playerid,GRÜN,"Du hast den Jackpot geknackt!!! Du hast 500.000$ gewonnen!!!");}
case 6:{format(string,sizeof(string),"~n~~r~!!!GOLDRAUSCH!!!~n~~g~%d$",100000*menge);GameTextForPlayer(playerid,string,10000,6);GivePlayerCash(playerid,100000*menge);SendClientMessage(playerid,GRÜN,"Du hast einen Goldrausch!!! Du hast 100.000$ gewonnen!!!");}
}
}
else
{
GameTextForPlayer(playerid,"~r~VERLOREN~n~~r~Diesmal hattest du Pech...",10000,6);
SendClientMessage(playerid,ROT,"Du hast Verloren... Vielleicht beim nächsten Mal.");
}
return SetTimerEx("OAB_END",5000,false,"u",playerid);
}
Weiß einer vielleicht wo der Fehler liegt?
Ihr könnt es euch ja mal selbst rein machen und gucken was daran falsch ist