Szerző Téma: Error  (Megtekintve 728 alkalommal)

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Error
« Dátum: 2012. november 12. - 21:15:07 »
0 Show voters

#include <a_samp>
#include <foreach>
#include <zcmd>
#include <dini>
// Coins
enum PLAYER_MAIN
{
   Coins
}
new pInfo[MAX_PLAYERS][PLAYER_MAIN];
//Sumo
new SUMO[MAX_PLAYERS];
new SUMOCAR2[MAX_PLAYERS];
new Roman[MAX_PLAYERS];
new SumoCar[MAX_PLAYERS];
new SumoPlayers;
new InSumo[MAX_PLAYERS];
new Float:SumoSpawn2 [][4] =
{
{1522.8535,-1260.7614,198.6326,202.2600},
{1512.7456,-1335.3345,198.6875,326.3046},
{1504.8740,-1270.8276,198.7156,225.3372},
{1564.9799,-1322.8571,198.6505,55.6632},
{1569.9921,-1292.7355,198.5749,100.7271},
{1495.2258,-1315.1505,198.6928,292.8104},
{1493.1748,-1290.9005,198.6734,258.1606}
};
#define ScoreWin 25
#define CashWin 1500
#define red 0xFF0000AA
new file[100];
new Name[MAX_PLAYER_NAME];
public OnPlayerConnect(playerid)
{
    InSumo[playerid] =0;//Sumo MG
    SUMO[playerid]=0;
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    SUMO[playerid]=0;
if(InSumo[playerid] == 1)
{
DestroyVehicle(SumoCar[playerid]);
    SumoPlayers--;
InSumo[playerid] = 0;
new string[1900];
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"%s {cccccc}lost his car in Car Sumo Minigame!\", Name(playerid));
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"%s {cccccc}lost his car in Car Sumo Minigame!\", Name(playerid));
    }
    SendClientMessageToAll(red,string);
    if(SumoPlayers == 1)
    {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
    if(InSumo == 1)
    {
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}win car sumo minigame! {3399ff}+%d {cccccc}Score and {3399ff}+100 {cccccc}Coins and {3399ff}+%d{cccccc}$ \", Name(i),ScoreWin,CashWin);
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}a castigat car sumo minigame! {3399ff}+%d {cccccc}Score si {3399ff}+100 {cccccc}Coins si {3399ff}+%d{cccccc}$\", Name(i),ScoreWin,CashWin);
    }
    SendClientMessageToAll(red,string);
    SetPlayerScore(i,GetPlayerScore(i)+ScoreWin);
    GivePlayerMoney(i,CashWin);
    pInfo[playerid][Coins] += 100;
dini_IntSet(file,\"Coins\", pInfo[playerid][Coins]);
    SumoPlayers = 0;
    SumoStarted = 0;
    DestroyVehicle(SumoCar);
SetTimerEx(\"SpawnPP\",1000,0,\"i\",i);
InSumo = 0;
    }
    }
    }
}
    return 1;
}
forward SumoRandomCar(playerid);
public SumoRandomCar(playerid)
{
    new pRandom = random(sizeof(SumoSpawn2));
    new vRandom = random(5);
    switch (vRandom)
    {
          case 0:
{DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(475,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
case 1:
{DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(504,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
case 2:
{DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(560,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
    case 3:
    {DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(438,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
         case 4:
    {DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(596,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
    }
    return SUMOCAR2[playerid];
}
public OnPlayerUpdate(playerid)
{
    if(SUMO[playerid]==1)
    {   new Float:x,Float:y,Float:z;
       if(GetPlayerPos(playerid,x,y,z) && z < 35)
{
            RemovePlayerFromVehicle(playerid);
            PutPlayerInVehicle(playerid,SumoRandomCar(playerid),0);
   return 1;
}
}
return true;
}
CMD:sumo(playerid,params[])
{
        if(InSumo[playerid] == 0){
if(SumoStarted == 0){
    if(Roman[playerid] == 0)
       {
SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo {cccccc}minigame has been Started! Type {ff0000}/sumo {cccccc}to join!\");
}
    if(Roman[playerid] == 1)
       {
       SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo {cccccc}minigame a inceput! Scrie {ff0000}/sumo {cccccc}ca sa te alaturi!\");
       }
SumoStarted=1;
InSumo[playerid] = 1;
SumoSpawn=2;
SumoCar[playerid] = AddStaticVehicle(471,628.465,2919.210,5.828,11.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
SumoTimer = SetTimer(\"StartSumo\",600,1);
SumoSec = 20;
TogglePlayerControllable(playerid,0);
SumoPlayers = 1;
}else
if(SumoStarted == 1)
{
SumoPlayers++;
if(SumoSpawn == 2)
{
SumoSpawn=3;
SumoCar[playerid] = AddStaticVehicle(471,615.871,2916.907,5.828,11.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
TogglePlayerControllable(playerid,0);
}else
if(SumoSpawn == 3)
{
SumoSpawn=4;
SumoCar[playerid] = AddStaticVehicle(471,604.882,2914.607,5.828,11.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
TogglePlayerControllable(playerid,0);
}else
if(SumoSpawn == 4)
{
SumoSpawn=5;
SumoCar[playerid] = AddStaticVehicle(471,593.613,2912.360,5.828,11.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
TogglePlayerControllable(playerid,0);
}else
if(SumoSpawn == 5)
{
SumoSpawn=6;
SumoCar[playerid] = AddStaticVehicle(471,614.750,2987.410,5.835,192.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
TogglePlayerControllable(playerid,0);
}else
if(SumoSpawn == 6)
{
SumoSpawn=7;
SumoCar[playerid] = AddStaticVehicle(471,634.110,2991.212,5.835,192.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
TogglePlayerControllable(playerid,0);
}else
if(SumoSpawn == 7)
{
SumoSpawn=8;
SumoCar[playerid] = AddStaticVehicle(471,654.411,2994.845,5.835,192.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
TogglePlayerControllable(playerid,0);
}else
if(SumoSpawn == 8)
{
SumoSpawn=9;
SumoCar[playerid] = AddStaticVehicle(471,585.599,2956.369,5.853,282.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
TogglePlayerControllable(playerid,0);
}else
if(SumoSpawn == 9)
{
SumoSpawn=10;
KillTimer(SumoTimer);
SumoCar[playerid] = AddStaticVehicle(471,661.134,2956.228,5.737,101.0,-1,-1);
PutPlayerInVehicle(playerid,SumoCar[playerid],0);
InSumo[playerid] = 1;
SumoStarted = 2;
SendClientMessageToAll(0xAA3333AA,\"{cccccc}Just fuck up your car! {3399ff}Car Sumo Minigame {cccccc}Started!\");
for(new i = 0; i < GetMaxPlayers(); i++)
        {
            if(InSumo == 1)
            {
      TogglePlayerControllable(i,1);
      GameTextForPlayer(i,\"~r~~h~Fuck up the Sumo Game!\",3000,3);
      SetTimerEx(\"Eliminat\",500,0,\"i\",i);
               return 1;
            }
            return 1;
        }
        }
        }else SendClientMessage(playerid,0xAA3333AA,\"{3399ff}Car Sumo Minigame {cccccc}is already Started!\");
}else SendClientMessage(playerid,0xAA3333AA,\"{cccccc}You are already in {3399ff}Car Sumo Minigame!\");
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    if(InSumo[playerid] == 1)
{
DestroyVehicle(SumoCar[playerid]);
    SumoPlayers--;
InSumo[playerid] = 0;
new string [1900];
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"%s {cccccc}lost his car in Car Sumo Minigame!\", Name(playerid));
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"%s {cccccc}si-a pierdut masina in Car Sumo Minigame!\", Name(playerid));
    }
    SendClientMessageToAll(red,string);
    if(SumoPlayers == 1)
    {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
    if(InSumo == 1)
    {
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}win car sumo minigame! {3399ff}+%d {cccccc}Score and {3399ff}+50 {cccccc}Coins and {3399ff}+%d{cccccc}$ \", Name(i),ScoreWin,CashWin);
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}a castigat car sumo minigame! {3399ff}+%d {cccccc}Score si {3399ff}+100 {cccccc}Coins si {3399ff}+%d{cccccc}$\", Name(i),ScoreWin,CashWin);
    }
//    new file [127];
    SendClientMessageToAll(red,string);
    SetPlayerScore(i,GetPlayerScore(i)+ScoreWin);
    GivePlayerMoney(i,CashWin);
    pInfo[playerid][Coins] += 50;
dini_IntSet(file,\"Coins\", pInfo[playerid][Coins]);
    SumoPlayers = 0;
    SumoStarted = 0;
    new Float:x,Float:y,Float:z;
    GetPlayerPos(i,x,y,z);
    SetPlayerPos(i,x,y,z+1);
    DestroyVehicle(SumoCar);
    SetTimerEx(\"SpawnPP\",1000,0,\"i\",i);
TogglePlayerControllable(i,1);
InSumo = 0;
    }
    }
    }
}
return 1;
}
public OnPlayerSpawn(playerid)
{
    InSumo[playerid] =0;//Sumo MG
      if(SUMO[playerid]==1)
    {
PutPlayerInVehicle(playerid,SumoRandomCar(playerid),0);
}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
/*     if(vehicleid==SumoCar)
{
    DestroyVehicle(vehicleid);
          }
}*/
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(InSumo[playerid] == 1)
    {
       PutPlayerInVehicle(playerid,SumoCar[playerid],0);
    }
    return 1;
}
//Sumo
forward StartSumo(playerid);
public StartSumo(playerid)
{
      if(SumoSec > 1)
  {
new time;
SumoSec--;
time = (SumoSec);
format(strec, sizeof(strec), \"~g~%d ~w~seconds remaining\", time);
for(new i = 0; i < GetMaxPlayers(); i++)
        {
        if(InSumo == 1)
        {
GameTextForPlayer(i, strec, 3000, 3);
}
}
      }
      if(SumoSec == 1)
  {
SumoSec = 0;
if(SumoPlayers >= 2)
{
for(new i = 0; i < GetMaxPlayers(); i++)
        {
        if(InSumo == 1)
        {
GameTextForPlayer(i, \"~g~~h~Sumo~n~~r~~h~START\", 3000, 3);
KillTimer(SumoTimer);
TogglePlayerControllable(i,1);
SumoStarted=2;
SetTimerEx(\"Eliminat\",500,0,\"i\",i);
}
}
}else
if(SumoPlayers < 2)
{
        for(new i = 0; i < GetMaxPlayers(); i++)
        {
        if(InSumo == 1)
        {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(i,x,y,z);
        SetPlayerPos(i,x,y,z+1);
        DestroyVehicle(SumoCar);
        SetTimerEx(\"SpawnPP\",1000,0,\"i\",i);
KillTimer(SumoTimer);
InSumo =0;
TogglePlayerControllable(i,1);
}
}
SumoStarted=0;
if(Roman[playerid] == 0)
       {
SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo Minigame {cccccc}has been finished! {3399ff}Reason: {cccccc}minim players is two!\");
}
if(Roman[playerid] == 1)
       {
       SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo Minigame {cccccc}s-a terminat! {3399ff}Reason: {cccccc}trebuie minim 2 jucatori!\");
       }
}
        }
      return 1;
}

 
Találtam egy ilyen szkriptet de van benne pár error de nem találom mi.. valaki javítani tudná? :OO

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Error
« Válasz #1 Dátum: 2012. november 12. - 21:16:41 »
0 Show voters
Ha bemásolnád az errorokat, könnyebb lenne segíteni.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Error
« Válasz #2 Dátum: 2012. november 12. - 21:17:59 »
0 Show voters

C:\\Users\\Desktop\\samp\\filterscripts\\minigame.pwn(58) : error 012: invalid function call, not a valid address
C:\\Users\\Desktop\\samp\\filterscripts\\minigame.pwn(58) : warning 215: expression has no effect
C:\\Users\\Desktop\\samp\\filterscripts\\minigame.pwn(58) : error 001: expected token: \";\", but found \")\"
C:\\Users\\Desktop\\samp\\filterscripts\\minigame.pwn(58) : error 029: invalid expression, assumed zero
C:\\Users\\Desktop\\samp\\filterscripts\\minigame.pwn(58) : fatal error 107: too many error messages on one line

 
de épp az abba a sorban nincs semmi hiba.. :D

Nem elérhető Kovacs_Richard

  • 1743
  • HRP Fejlesztő
  • Discord: Kovacs_Richard#0321
    • Profil megtekintése
    • Hun Role Play Web
Error
« Válasz #3 Dátum: 2012. november 12. - 21:21:52 »
0 Show voters
Name(playerid)

 
másold be a függvényt
Régóta nem tevékenykedem, mint SA-MP scripter.
HRP Fejlesztő.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Error
« Válasz #4 Dátum: 2012. november 12. - 21:23:12 »
0 Show voters
Most nézem nincs olyan függvény létrehozva  :OO
E: Na meg csináltam így de úgyan az a hiba..
 

stock Name(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
« Utoljára szerkesztve: 2012. november 12. - 21:27:33 írta ZyZu »

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Error
« Válasz #5 Dátum: 2012. november 12. - 21:32:25 »
+1 Show voters
#include <a_samp>
#include <foreach>
#include <zcmd>
#include <dini>
// Coins
enum PLAYER_MAIN
{
   Coins
}
new pInfo[MAX_PLAYERS][PLAYER_MAIN];
//Sumo
new SUMO[MAX_PLAYERS];
new SUMOCAR2[MAX_PLAYERS];
new Roman[MAX_PLAYERS];
new SumoCar[MAX_PLAYERS];
new SumoPlayers;
new InSumo[MAX_PLAYERS];
new Float:SumoSpawn2 [][4] =
{
{1522.8535,-1260.7614,198.6326,202.2600},
{1512.7456,-1335.3345,198.6875,326.3046},
{1504.8740,-1270.8276,198.7156,225.3372},
{1564.9799,-1322.8571,198.6505,55.6632},
{1569.9921,-1292.7355,198.5749,100.7271},
{1495.2258,-1315.1505,198.6928,292.8104},
{1493.1748,-1290.9005,198.6734,258.1606}
};
#define ScoreWin 25
#define CashWin 1500
#define red 0xFF0000AA
new file[100];
new Nev[MAX_PLAYER_NAME];
public OnPlayerConnect(playerid)
{
    InSumo[playerid] =0;//Sumo MG
    SUMO[playerid]=0;
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    SUMO[playerid]=0;
        if(InSumo[playerid] == 1)
        {
        DestroyVehicle(SumoCar[playerid]);
    SumoPlayers--;
        InSumo[playerid] = 0;
        new string[1900];
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"%s {cccccc}lost his car in Car Sumo Minigame!\", Name(playerid));
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"%s {cccccc}lost his car in Car Sumo Minigame!\", Name(playerid));
    }
    SendClientMessageToAll(red,string);
    if(SumoPlayers == 1)
    {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
    if(InSumo == 1)
    {
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}win car sumo minigame! {3399ff}+%d {cccccc}Score and {3399ff}+100 {cccccc}Coins and {3399ff}+%d{cccccc}$ \", Name(i),ScoreWin,CashWin);
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}a castigat car sumo minigame! {3399ff}+%d {cccccc}Score si {3399ff}+100 {cccccc}Coins si {3399ff}+%d{cccccc}$\", Name(i),ScoreWin,CashWin);
    }
    SendClientMessageToAll(red,string);
    SetPlayerScore(i,GetPlayerScore(i)+ScoreWin);
    GivePlayerMoney(i,CashWin);
    pInfo[playerid][Coins] += 100;
        dini_IntSet(file,\"Coins\", pInfo[playerid][Coins]);
    SumoPlayers = 0;
    SumoStarted = 0;
    DestroyVehicle(SumoCar);
        SetTimerEx(\"SpawnPP\",1000,0,\"i\",i);
        InSumo = 0;
    }
    }
    }
        }
    return 1;
}
forward SumoRandomCar(playerid);
public SumoRandomCar(playerid)
{
    new pRandom = random(sizeof(SumoSpawn2));
    new vRandom = random(5);
    switch (vRandom)
    {
            case 0:
                {DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(475,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
                case 1:
                {DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(504,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
                case 2:
                {DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(560,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
                case 3:
                {DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(438,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
                case 4:
                {DestroyVehicle(SUMOCAR2[playerid]);SUMOCAR2[playerid] = CreateVehicle(596,SumoSpawn2[pRandom][0], SumoSpawn2[pRandom][1], SumoSpawn2[pRandom][2], SumoSpawn2[pRandom][3],-1,-1,9999999);}
    }
    return SUMOCAR2[playerid];
}
public OnPlayerUpdate(playerid)
{
    if(SUMO[playerid]==1)
    {   new Float:x,Float:y,Float:z;
        if(GetPlayerPos(playerid,x,y,z) && z < 35)
                {
            RemovePlayerFromVehicle(playerid);
            PutPlayerInVehicle(playerid,SumoRandomCar(playerid),0);
                        return 1;
                }
        }
        return true;
}
CMD:sumo(playerid,params[])
        {
        if(InSumo[playerid] == 0){
                if(SumoStarted == 0){
                if(Roman[playerid] == 0)
        {
                SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo {cccccc}minigame has been Started! Type {ff0000}/sumo {cccccc}to join!\");
                }
                if(Roman[playerid] == 1)
        {
        SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo {cccccc}minigame a inceput! Scrie {ff0000}/sumo {cccccc}ca sa te alaturi!\");
        }
                SumoStarted=1;
                InSumo[playerid] = 1;
                SumoSpawn=2;
                SumoCar[playerid] = AddStaticVehicle(471,628.465,2919.210,5.828,11.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                SumoTimer = SetTimer(\"StartSumo\",600,1);
                SumoSec = 20;
                TogglePlayerControllable(playerid,0);
                SumoPlayers = 1;
                }else
                if(SumoStarted == 1)
                {
                SumoPlayers++;
                if(SumoSpawn == 2)
                {
                SumoSpawn=3;
                SumoCar[playerid] = AddStaticVehicle(471,615.871,2916.907,5.828,11.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                TogglePlayerControllable(playerid,0);
                }else
                if(SumoSpawn == 3)
                {
                SumoSpawn=4;
                SumoCar[playerid] = AddStaticVehicle(471,604.882,2914.607,5.828,11.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                TogglePlayerControllable(playerid,0);
                }else
                if(SumoSpawn == 4)
                {
                SumoSpawn=5;
                SumoCar[playerid] = AddStaticVehicle(471,593.613,2912.360,5.828,11.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                TogglePlayerControllable(playerid,0);
                }else
                if(SumoSpawn == 5)
                {
                SumoSpawn=6;
                SumoCar[playerid] = AddStaticVehicle(471,614.750,2987.410,5.835,192.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                TogglePlayerControllable(playerid,0);
                }else
                if(SumoSpawn == 6)
                {
                SumoSpawn=7;
                SumoCar[playerid] = AddStaticVehicle(471,634.110,2991.212,5.835,192.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                TogglePlayerControllable(playerid,0);
                }else
                if(SumoSpawn == 7)
                {
                SumoSpawn=8;
                SumoCar[playerid] = AddStaticVehicle(471,654.411,2994.845,5.835,192.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                TogglePlayerControllable(playerid,0);
                }else
                if(SumoSpawn == 8)
                {
                SumoSpawn=9;
                SumoCar[playerid] = AddStaticVehicle(471,585.599,2956.369,5.853,282.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                TogglePlayerControllable(playerid,0);
                }else
                if(SumoSpawn == 9)
                {
                SumoSpawn=10;
                KillTimer(SumoTimer);
                SumoCar[playerid] = AddStaticVehicle(471,661.134,2956.228,5.737,101.0,-1,-1);
                PutPlayerInVehicle(playerid,SumoCar[playerid],0);
                InSumo[playerid] = 1;
                SumoStarted = 2;
                SendClientMessageToAll(0xAA3333AA,\"{cccccc}Just fuck up your car! {3399ff}Car Sumo Minigame {cccccc}Started!\");
                for(new i = 0; i < GetMaxPlayers(); i++)
        {
            if(InSumo == 1)
            {
                           TogglePlayerControllable(i,1);
                           GameTextForPlayer(i,\"~r~~h~Fuck up the Sumo Game!\",3000,3);
                           SetTimerEx(\"Eliminat\",500,0,\"i\",i);
               return 1;
            }
            return 1;
        }
        }
        }else SendClientMessage(playerid,0xAA3333AA,\"{3399ff}Car Sumo Minigame {cccccc}is already Started!\");
                }else SendClientMessage(playerid,0xAA3333AA,\"{cccccc}You are already in {3399ff}Car Sumo Minigame!\");
                return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    if(InSumo[playerid] == 1)
        {
        DestroyVehicle(SumoCar[playerid]);
    SumoPlayers--;
        InSumo[playerid] = 0;
        new string [1900];
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"%s {cccccc}lost his car in Car Sumo Minigame!\", Name(playerid));
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"%s {cccccc}si-a pierdut masina in Car Sumo Minigame!\", Name(playerid));
    }
    SendClientMessageToAll(red,string);
    if(SumoPlayers == 1)
    {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
    if(InSumo == 1)
    {
    if(Roman[playerid] == 0)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}win car sumo minigame! {3399ff}+%d {cccccc}Score and {3399ff}+50 {cccccc}Coins and {3399ff}+%d{cccccc}$ \", Name(i),ScoreWin,CashWin);
    }
    if(Roman[playerid] == 1)
    {
    format(string, sizeof(string), \"{ff0000}%s {cccccc}a castigat car sumo minigame! {3399ff}+%d {cccccc}Score si {3399ff}+100 {cccccc}Coins si {3399ff}+%d{cccccc}$\", Name(i),ScoreWin,CashWin);
    }
//    new file [127];
    SendClientMessageToAll(red,string);
    SetPlayerScore(i,GetPlayerScore(i)+ScoreWin);
    GivePlayerMoney(i,CashWin);
    pInfo[playerid][Coins] += 50;
        dini_IntSet(file,\"Coins\", pInfo[playerid][Coins]);
    SumoPlayers = 0;
    SumoStarted = 0;
    new Float:x,Float:y,Float:z;
    GetPlayerPos(i,x,y,z);
    SetPlayerPos(i,x,y,z+1);
    DestroyVehicle(SumoCar);
    SetTimerEx(\"SpawnPP\",1000,0,\"i\",i);
        TogglePlayerControllable(i,1);
        InSumo = 0;
    }
    }
    }
        }
        return 1;
        }
public OnPlayerSpawn(playerid)
{
    InSumo[playerid] =0;//Sumo MG
        if(SUMO[playerid]==1)
    {
        PutPlayerInVehicle(playerid,SumoRandomCar(playerid),0);
        }
        return 1;
}
public OnVehicleSpawn(vehicleid)
{
/*      if(vehicleid==SumoCar)
                {
            DestroyVehicle(vehicleid);
        }
        }*/
        return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
        if(InSumo[playerid] == 1)
    {
        PutPlayerInVehicle(playerid,SumoCar[playerid],0);
    }
    return 1;
}
//Sumo
forward StartSumo(playerid);
public StartSumo(playerid)
{
      if(SumoSec > 1)
          {
                new time;
                SumoSec--;
                time = (SumoSec);
                format(strec, sizeof(strec), \"~g~%d ~w~seconds remaining\", time);
                for(new i = 0; i < GetMaxPlayers(); i++)
        {
        if(InSumo == 1)
        {
                GameTextForPlayer(i, strec, 3000, 3);
                }
                }
      }
      if(SumoSec == 1)
          {
                SumoSec = 0;
                if(SumoPlayers >= 2)
                {
                for(new i = 0; i < GetMaxPlayers(); i++)
        {
        if(InSumo == 1)
        {
                GameTextForPlayer(i, \"~g~~h~Sumo~n~~r~~h~START\", 3000, 3);
                KillTimer(SumoTimer);
                TogglePlayerControllable(i,1);
                SumoStarted=2;
                SetTimerEx(\"Eliminat\",500,0,\"i\",i);
                }
                }
                }else
                if(SumoPlayers < 2)
                {
        for(new i = 0; i < GetMaxPlayers(); i++)
        {
        if(InSumo == 1)
        {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(i,x,y,z);
        SetPlayerPos(i,x,y,z+1);
        DestroyVehicle(SumoCar);
        SetTimerEx(\"SpawnPP\",1000,0,\"i\",i);
                KillTimer(SumoTimer);
                InSumo =0;
                TogglePlayerControllable(i,1);
                }
                }
                SumoStarted=0;
                if(Roman[playerid] == 0)
        {
                SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo Minigame {cccccc}has been finished! {3399ff}Reason: {cccccc}minim players is two!\");
                }
                if(Roman[playerid] == 1)
        {
        SendClientMessageToAll(0x6495EDAA,\"{3399ff}Car Sumo Minigame {cccccc}s-a terminat! {3399ff}Reason: {cccccc}trebuie minim 2 jucatori!\");
        }
                }
        }
      return 1;
}
stock Name(playerid)
{
new name[24];
GetPlayerName(playerid,name,24);
return name;
}

Nem elérhető Kovacs_Richard

  • 1743
  • HRP Fejlesztő
  • Discord: Kovacs_Richard#0321
    • Profil megtekintése
    • Hun Role Play Web
Error
« Válasz #6 Dátum: 2012. november 12. - 21:36:24 »
+1 Show voters
new Name[MAX_PLAYER_NAME];

 
ezt nem használod sehol de ha ezt kitörlöm eltünnek az errorok...
 
new string[1900];

 
ennek tényleg szükséges ennyi cella?
Régóta nem tevékenykedem, mint SA-MP scripter.
HRP Fejlesztő.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Error
« Válasz #7 Dátum: 2012. november 12. - 21:40:27 »
0 Show voters
A cellát azt néztem én is csak elfeljtettem kicsire venni max 128 -ra. Kosz mindenkinek!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal