Szerző Téma: Szöveg hiba  (Megtekintve 2284 alkalommal)

Szöveg hiba
« Válasz #15 Dátum: 2011. december 01. - 15:26:14 »
0 Show voters
de valamiért nem megy :\'(

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Szöveg hiba
« Válasz #16 Dátum: 2011. december 01. - 15:27:22 »
0 Show voters
A módban, a OnDialogResponse alatt mennyi a visszatérési érték? Ott lesz a baj.

Szöveg hiba
« Válasz #17 Dátum: 2011. december 02. - 14:30:39 »
0 Show voters
[pawn]public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Othersdialog)
{
   if(listitem == 0)
   {
       gTeam[playerid] = TEAM_RAPIST;
      SendClientMessage(playerid,blue,\"\"lblue\"Your profession is now: \"lyellow\"Rapist\");
      SetPlayerPos(playerid,476.5808,-1510.1063,20.5598);
      GivePlayerWeapon(playerid,38,700);
      GivePlayerWeapon(playerid,22,2000);
   }
   if(listitem == 1)
   {
       gTeam[playerid] = TEAM_HITMAN;
      SendClientMessage(playerid,blue,\"\"lblue\"Your profession is now: \"lyellow\"Hitman\");
      SetPlayerPos(playerid,-1685.4331,1370.9609,9.7971);
      GivePlayerWeapon(playerid,4,1);
      GivePlayerWeapon(playerid,33,2000);
   }
}
if(dialogid == Admincmds)
{
    if(!response) return 0;
    if(listitem == 0)
    {
        ShowPlayerDialog(playerid,9899,0,\"\"lblue\"Level 1 Commands(VIP)\",\"\\t\\t\"lblue\"Level 1 (VIP Member) commands \\n\\n\"lwhite\"/fix /goto  /get\",\"OK\",\"\");
   }
   if(listitem == 1)
   {
       ShowPlayerDialog(playerid,9900,0,\"\"lgreen\"Admin Level 2 Commands\",\"\\t\\t\"lgreen\"Admin Level 2 Commands \\n\\n\"lwhite\"/slap /heal /(un)freeze /setweather /settime /kick /akill /ip\",\"OK\",\"\");
   }
   if(listitem == 2)
   {
       ShowPlayerDialog(playerid,9901,0,\"\"lgreen2\"Admin Level 3 Commands\",\"\\t\\t\"lgreen2\"Admin Level 3 Commands \\n\\n\"lwhite\"/giveallmoney /announce /ban /unban /healall /armourall /sethealth /setarmour /cancelpmission /setwantedlvl /goto /setmoney /(un)jail\",\"OK\",\"\");
   }
   if(listitem == 3)
   {
       ShowPlayerDialog(playerid,9902,0,\"\"lyellow2\"Admin Level 4 Commands\",\"\\t\\t\"lyellow2\"Admin Level 4 Commands \\n\\n\"lwhite\"/setname /createbank /setplayercompletedmissions /resetplayermissions\",\"OK\",\"\");
   }
   if(listitem == 4)
   {
       ShowPlayerDialog(playerid,9903,0,\"\"lorange\"Admin Level 5 Commands\",\"\\t\\t\"lorange\"Admin Level 5 Commands \\n\\n\"lwhite\"  \",\"OK\",\"\");
   }
}
if(dialogid == Cmdsdialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
      ShowPlayerDialog(playerid,5656,0,\"Trucker Commands\",\"\\n\\n\"lwhite\"/work  \"lgreen2\"Gives a mission to do \\n\"lwhite\"/sos   \"lgreen2\"Calls assistance\\n\"lwhite\"/cancelmission \"lgreen2\"Cancels current mission \\n\"lwhite\"/detach \"lgreen2\"Detaches the trailer\",\"Close\",\"\");
   }
   if(listitem == 1)
   {
       ShowPlayerDialog(playerid,5657,0,\"Police Commands\",\"\\n\\n\"lwhite\"/ticket <id>    \"lgreen2\"Gives the player specified a ticket \\n\"lwhite\"/arrest <id>    \"lgreen2\"Arrests the player specified \\n\"lwhite\"/suspects    \"lgreen2\"Shows online suspects\",\"Close\",\"\");
   }
   if(listitem == 2)
   {
       ShowPlayerDialog(playerid,5658,0,\"Assistance Commands\",\"\\n\\n\"lwhite\"/fixcar    \"lgreen2\"Fixes the nearest vehicle \\n\"lwhite\"/fuelcar   \"lgreen2\"Fills the nearest vehicle \\n\"lwhite\"Pressing key 2 on the keyboard     \"lgreen2\"Tows the nearest vehicle\",\"Close\",\"\");
   }
   if(listitem == 3)
   {
       ShowPlayerDialog(playerid,5659,0,\"Driver Commands\",\"\\n\\n\"lwhite\"/fare <amount>      \"lgreen2\"Sets the specified fare for 10 seconds while a client is in your vehicle \\n\"lwhite\"Leaving your vehicle        \"lgreen2\"Cancels the fare\",\"Close\",\"\");
   }
   if(listitem == 4)
   {
       ShowPlayerDialog(playerid,5660,0,\"Various Commands\",\"\\n\\n\"lwhite\"/rob      \"lgreen2\"Rob\'s a close player \\n\"lwhite\"/inventory        \"lgreen2\"Shows your inventory \\n\"lwhite\"/gps      \"lgreen2\"Opens your GPS \\n\"lwhite\"/phone      \"lgreen2\"Opens your phone \\n\",\"Close\",\"\");
   }
}
if(dialogid == Unbandialog)
{
    new file[128],string[128],IP[16],name[MAX_PLAYER_NAME];
    if(strlen(inputtext) == 0) return SendClientMessage(playerid,white,\"*\"lred\"Please put in an ip!\");
    format(file,sizeof(file),\"Admin/Bans/%s.ini\",inputtext);
   if(INI_Exist(file))
   {
       INI_Open(file);
        INI_ReadString(IP,\"PlayerIP\",16);
        INI_ReadString(name,\"Player\",23);
            format(string,sizeof(string),\"**** Player %s(IP %s) has been successfully unbanned!\",name,IP);
       SendClientMessage(playerid,green2,string);
       INI_Remove(file);
       INI_Close();
       format(file,sizeof(file),\"Admin/Users/%s.ini\",name);
      INI_Open(file);
      INI_WriteInt(\"Banned\",0);
      INI_Save();
       INI_Close();
       PlaySound(playerid,1054);
   }
   else
   {
      format(string,sizeof(string),\"*** \"lyellow2\"\\\"%s\\\"\"lgreen\" is an invalid ip!\",inputtext);
      SendClientMessage(playerid,red,string);
   }
}
if(dialogid == Depositdialog)
{
    if(!response) return ShowPlayerDialog(playerid,Bankdialog,2,\"Welcome to the bank!\",\"\"lyellow2\"Deposit cash \\nWithdraw cash \\nTransfer money to player\",\"Go\",\"Close\");
   if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,Depositdialog,1,\"Deposit money\",\"Enter the amount you want to deposit: \\n\",\"Deposit!\",\"Back\");
         if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid,red,\"*** You don\'t have that much cash!\") && ShowPlayerDialog(playerid,5775,1,\"Deposit money\",\"Enter the amount you want to deposit: \\n\",\"Deposit!\",\"Back\");
   PInfo[playerid][depositcash] += strval(inputtext);
   GivePlayerMoney(playerid,-strval(inputtext));
   SendFMessage(playerid,green,\"*** You have successfully deposited $%d in the bank... you have now a total of $%d in the bank!\",strval(inputtext),PInfo[playerid][depositcash]);
}
if(dialogid == Withdrawdialog)
{
       if(!response) return ShowPlayerDialog(playerid,Bankdialog,2,\"Welcome to the bank!\",\"\"lyellow2\"Deposit cash \\nWithdraw cash \\nTransfer money to player\",\"Go\",\"Close\");
         if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,Withdrawdialog,1,\"Withdraw money\",\"Enter the amount of money that you want to \"lyellow\"withdraw: \\n\",\"Withdraw!\",\"Back\");
    if(strval(inputtext) > PInfo[playerid][depositcash]) return SendClientMessage(playerid,red,\"*** You don\'t have that much money deposited in the bank!\") && ShowPlayerDialog(playerid,5776,1,\"Withdraw money\",\"Enter the amount of money that you want to \"lyellow\"withdraw: \\n\",\"Withdraw!\",\"Back\");
       PInfo[playerid][depositcash] -= strval(inputtext);
    GivePlayerMoney(playerid,strval(inputtext));
   SendFMessage(playerid,green,\"*** You\'ve withdrawed \"lyellow2\"$%d\"lgreen\" from the bank, you now have \"lyellow2\"$%d\"lgreen\" in it!\",strval(inputtext),PInfo[playerid][depositcash]);
}
if(dialogid == Bankdialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
      ShowPlayerDialog(playerid,Depositdialog,1,\"Deposit money\",\"Enter the amount you want to deposit: \\n\",\"Deposit!\",\"Back\");
   }
   if(listitem == 1)
   {
            ShowPlayerDialog(playerid,Withdrawdialog,1,\"Withdraw money\",\"Enter the amount of money that you want to \"lyellow\"withdraw: \\n\",\"Withdraw!\",\"Back\");
   }
   if(listitem == 2)
   {
       new string[128];
       format(string,sizeof(string),\"\"lwhite\"You currently have \"lblue\"$%i\"lwhite\" in the bank!\",PInfo[playerid][depositcash]);
       ShowPlayerDialog(playerid,5656,0,\"\"lgreen2\"Balance\",string,\"OK\",\"\");
   }
}
    if(dialogid == Gpsdialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
        SetPlayerGPS(playerid,2);
    }
}
if(dialogid == Weaponsdialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
        GivePlayerWeapon(playerid,3,1);
        GivePlayerWeapon(playerid,22,500);
        GivePlayerWeapon(playerid,29,800);
        }
        if(listitem == 1)
    {
        GivePlayerWeapon(playerid,3,1);
        GivePlayerWeapon(playerid,34,500);
        GivePlayerWeapon(playerid,23,500);
        }
        if(listitem == 2)
    {
        GivePlayerWeapon(playerid,3,1);
        GivePlayerWeapon(playerid,22,500);
        GivePlayerWeapon(playerid,32,800);
        }
}
if(dialogid == Copsdialog)
{
    if(listitem == 0)
    {
      SetPlayerPos(playerid,1539.4375,-1638.9146,6.2188);
      SetPlayerFacingAngle(playerid,179.8883);
      SendClientMessage(playerid,red,\"SPAWN: \"lgrey\"Los Santos!\");
   }
   if(listitem == 1)
    {
      SetPlayerPos(playerid,2282.1499,2424.4517,3.4692);
      SetPlayerFacingAngle(playerid,8.3251);
            SendClientMessage(playerid,red,\"SPAWN: \"lgrey\"Las Venturas!\");
   }
   if(listitem == 2)
    {
      SetPlayerPos(playerid,-1620.4846,688.3687,7.1875);
      SetPlayerFacingAngle(playerid,178.6072);
      SendClientMessage(playerid,red,\"SPAWN: \"lgrey\"San Fierro!\");
   }
   ShowPlayerDialog(playerid,Weaponsdialog,2,\"Weapons\",\"Fast runner \\nSneak out \\nCatch\'em high\",\"Choose\",\"\");
}
if(dialogid == Registerdialog)
{
    new string[200],file[128];
    format(string,sizeof(string),\"\"lred\"Please put in a password \\n\"lgreen\"Welcome to \"lyellow\"Ultimate Trucking\"lgreen\", \"lyellow2\"%s\"lgreen\"! \\nYou are \"lred\"not registered\"lgreen\".\\n\"lgrey\"Please input the desired \"lyellow2\"password\"lgreen\"to register!\",GetPName(playerid));
    format(string,sizeof(string),\"||- \"lwhite\"%s \"lred\" has been kicked for not \"lyellow2\"registering \"lred\"-||\",GetPName(playerid));
   if(!response) return Kick(playerid) && SendClientMessage(playerid,red,\"\"lred\"You must \"lgreen\"register \"lred\"to play in this server\") && SendClientMessageToAll(red,string);
   if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,Registerdialog,1,\"\"lyellow\"REGISTER AN ACCOUNT\",string,\"Register\",\"Cancel\");
   format(file,sizeof(file),\"Admin/Users/%s.ini\",GetPName(playerid));
   INI_Open(file);
   INI_WriteString(\"Password\",inputtext);
   INI_WriteInt(\"Truckingdone\",0);
   INI_WriteInt(\"Missionsdone\",0);
   INI_WriteInt(\"Missionsfailed\",0);
   INI_WriteInt(\"Truckingdone\",0);
   INI_WriteInt(\"Level\",0);
   INI_WriteInt(\"Money\",0);
   INI_WriteInt(\"Phone\",0);
   INI_WriteInt(\"GPS\",0);
   INI_WriteInt(\"Fuel\",0);
   INI_WriteInt(\"KM\",0);
   INI_WriteInt(\"Jailed\",0);
   INI_WriteInt(\"Frozen\",0);
   INI_WriteInt(\"Arrested\",0);
        INI_WriteInt(\"Suspected\",0);
        INI_WriteInt(\"Deposited\",0);
        INI_WriteInt(\"Banned\",0);
   INI_Save();
   INI_Close();
   SendClientMessage(playerid,red,\"\"lgreen\"» You have successfully \"lyellow\"registered\"lgreen\"!\");
   format(string,sizeof(string),\"\"lgreen\"Welcome back, \"lyellow2\"%s\"lgreen\"! Please enter your \"lred\"password \"lgreen\"to log in!\",GetPName(playerid));
        ShowPlayerDialog(playerid,Logindialog,1,\"\"lyellow\"LOGIN YOUR ACCOUNT\",string,\"Login\",\"Cancel\");
}
if(dialogid == Logindialog)
{
    new string[200],password[128],file[128];
    format(string,sizeof(string),\"\"lgreen\"Welcome back, \"lyellow2\"%s\"lgreen\"! Please enter your \"lred\"password \"lgreen\"to log in!\",GetPName(playerid));
    if(!response) return SendClientMessage(playerid,red,\"Please put in a \"lgreen\"password\"lred\"!\") && ShowPlayerDialog(playerid,Logindialog,1,\"\"lyellow\"LOGIN YOUR ACCOUNT\",string,\"Login\",\"Cancel\");
   if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,Logindialog,1,\"\"lyellow\"LOGIN YOUR ACCOUNT\",string,\"Login\",\"Cancel\");
   format(file,sizeof(file),\"Admin/Users/%s.ini\",GetPName(playerid));
   INI_Open(file);
   if (INI_ReadString(password, \"Password\", 25))
        {
            if (!strcmp(password, inputtext, false))
            {
                PInfo[playerid][Level] = INI_ReadInt(\"Level\");
         PInfo[playerid][Missionspassed] = INI_ReadInt(\"Missionsdone\");
         PInfo[playerid][Missionsfailed] = INI_ReadInt(\"Missionsfailed\");
         PInfo[playerid][hasphone] = INI_ReadInt(\"Phone\");
         PInfo[playerid][hasfuelcan] = INI_ReadInt(\"Fuel\");
         PInfo[playerid][hasgps] = INI_ReadInt(\"GPS\");
         PInfo[playerid][Jailed] = INI_ReadInt(\"Jailed\");
         PInfo[playerid][arrestedppl] = INI_ReadInt(\"Arrested\");
         PInfo[playerid][wantedlevel] = INI_ReadInt(\"Suspected\");
         PInfo[playerid][depositcash] = INI_ReadInt(\"Deposited\");
         PInfo[playerid][Failedlogins] = 0;
                PInfo[playerid][Logged] = 1;
         SetPlayerMoney(playerid,INI_ReadInt(\"Money\"));
         SetPlayerScore(playerid,PInfo[playerid][Missionspassed]);
         SetPlayerWantedLevel(playerid,PInfo[playerid][wantedlevel]);
         pKMs[playerid] = INI_ReadInt(\"KM\");
                SendClientMessage(playerid,red,\"\"lgreen\"» You have successfully \"lyellow\"logged in\"lgreen\"!\");
      }
      else
      {
          PInfo[playerid][Failedlogins]++;
          format(string,sizeof(string),\"\"lred\"Failed: %i/3\\n\"lgreen\"Welcome back, \"lyellow2\"%s\"lgreen\"! Please enter your \"lred\"password \"lgreen\"to log in!\",PInfo[playerid][Failedlogins],GetPName(playerid));
                ShowPlayerDialog(playerid,Logindialog,1,\"\"lyellow\"LOGIN YOUR ACCOUNT\",string,\"Login\",\"Cancel\");
      }
      if(PInfo[playerid][Failedlogins] >= 3)
      {
          SendFMessageToAll(red,\"||- \"lwhite\"%s \"lred\"has been kicked for max failed logins. -||\",GetPName(playerid));
          Kick(playerid);
            }
   }
   INI_Close();
}
if(dialogid == tsdialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
        if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid,red,\"You don\'t have enough \"lgreen\"money\"lred\"!\");
            if(PInfo[playerid][hasfuelcan] == 1) return SendClientMessage(playerid,red,\"You already have a \"lgreen\"fuel can\"lred\"!\");
      PInfo[playerid][hasfuelcan] = 1;
      SendClientMessage(playerid,red,\"[TS]\"lgrey\"You have \"lgreen\"succesfully \"lgrey\" bought a \"lyellow2\"fuel can\"lgrey\"!\");
      GivePlayerMoney(playerid,-2000);
   }
   if(listitem == 1)
   {
       if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,red,\"You don\'t have enough \"lgreen\"money\"lred\"!\");
      if(PInfo[playerid][hasphone] == 1) return SendClientMessage(playerid,red,\"You already have a \"lgreen\"cell phone\"lred\"!\");
      if(PInfo[playerid][Missionspassed] < 30) return SendClientMessage(playerid,red,\"You \"lgreen\"need \"lred\"at least \"lyellow2\"30 \"lred\"missions passed!\");
      SendClientMessage(playerid,red,\"[TS]\"lgrey\"You have \"lgreen\"succesfully \"lgrey\" bought a \"lyellow2\"cell phone\"lgrey\"!\");
      PInfo[playerid][hasphone] = 1;
      GivePlayerMoney(playerid,-5000);
   }
   if(listitem == 2)
   {
       if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,red,\"You don\'t have enough \"lgreen\"money\"lred\"!\");
      if(PInfo[playerid][hasgps] == 1) return SendClientMessage(playerid,red,\"You already have a \"lgreen\"gps\"lred\"!\");
      if(PInfo[playerid][Missionspassed] < 30) return SendClientMessage(playerid,red,\"You \"lgreen\"need \"lred\"at least \"lyellow2\"30 \"lred\"missions passed!\");
      SendClientMessage(playerid,red,\"[TS]\"lgrey\"You have \"lgreen\"succesfully \"lgrey\" bought a \"lyellow2\"gps\"lgrey\"!\");
      PInfo[playerid][hasgps] = 1;
      GivePlayerMoney(playerid,-10000);
   }
   if(listitem == 3)
   {
      GivePlayerMoney(playerid,-200);
      wallet[playerid] = 3;
      SendClientMessage(playerid,green2,\">> You bought a wallet! It will protect you from 3 robberies.\");
   }
}
if(dialogid == invdialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
        if(PInfo[playerid][hasfuelcan] == 0) return SendClientMessage(playerid,red,\"You don\'t have a \"lgreen\"fuel can\"lred\"!\");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,\"You must be in a vehicle\");
      PInfo[playerid][hasfuelcan] = 0;
      fuel[GetPlayerVehicleID(playerid)] = fuel[GetPlayerVehicleID(playerid)] +20;
      new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
       SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,lights,alarm,doors,bonnet,boot,objective);
         if(fuel[GetPlayerVehicleID(playerid)] <= 100 || fuel[GetPlayerVehicleID(playerid)] >= 100)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~g~~h~IIIIIIIIII\");
      }
      if(fuel[GetPlayerVehicleID(playerid)] <= 90)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~g~~h~IIIIIIIII~r~I\");
         }
         if(fuel[GetPlayerVehicleID(playerid)] <= 80)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~g~~h~IIIIIIII~r~II\");
         }
         if(fuel[GetPlayerVehicleID(playerid)] <= 70)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~g~~h~IIIIIII~r~III\");
         }
         if(fuel[GetPlayerVehicleID(playerid)] <= 60)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~g~~h~IIIIII~r~IIII\");
         }
         if(fuel[GetPlayerVehicleID(playerid)] <= 50)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~g~~h~IIIII~r~IIIII\");
         }
         if(fuel[GetPlayerVehicleID(playerid)] <= 40)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~g~~h~IIII~r~IIIII\");
         }
         if(fuel[GetPlayerVehicleID(playerid)] <= 30)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~G~III~r~IIIIIII\");
         }
         if(fuel[GetPlayerVehicleID(playerid)] <= 20)
      {
          TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~G~II~r~IIIIIIII\");
         }
      if(fuel[GetPlayerVehicleID(playerid)] <= 10)
      {
            TextDrawSetString(fueltd[playerid],\"~b~~h~Fuel: ~G~I~r~IIIIIIIII\");
      }
      if(fuel[GetPlayerVehicleID(playerid)] == 0)
      {
          TextDrawSetString(fueltd[playerid],\"~b~Fuel: ~r~~h~/\");
         GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
          SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,lights,alarm,doors,bonnet,boot,objective);
        }
   }
   if(listitem == 1)
   {
       if(PInfo[playerid][hasphone] == 0) return SendClientMessage(playerid,red,\"\"lred\"You don\'t have a \"lgreen\"phone! \"lred\"Head over to TS to buy one.\");
      ShowPlayerDialog(playerid,Choosecalldialog,2,\"Who would you like to call?\",\"Call a friend \\nCall assistance\",\"Call\",\"Cancel\");
   }
   if(listitem == 2)
   {
       return dcmd_gps(playerid,inputtext);
        }
}
if(dialogid == Choosecalldialog)
{
    if(!response) return 0;
    if(PInfo[playerid][hasphone] == 0) return SendClientMessage(playerid,red,\"\"lred\"You don\'t have a \"lgreen\"phone! \"lred\"Head over to TS to buy one.\");
    if(listitem == 0)
    {
      ShowPlayerDialog(playerid,phonedialog,1,\"Phone\",\"Who would you like to phone? Insert the player\'s id/nickname\",\"Call\",\"Cancel\");
       }
       if(listitem == 1)
    {
      ShowPlayerDialog(playerid,Assidialog,2,\"Assistance: Welcome, how could we help you?\",\"Flip my vehicle(\"lgreen\"Free!\"lwhite\") \\nRepair my vehicle \\nSend a SOS message to assistence\",\"Call\",\"Cancel\");
       }
       if(listitem == 2)
       {
      dcmd_taxi(playerid,inputtext);
   }
}
if(dialogid == rescuedialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
        ShowPlayerDialog(playerid,fueldialog,2,\"\"lyellow\"REFILL\",\"+1($1000)\\n+2($2,000) \\n+3($3,000) \\n+4($4,000) \\n+5($5,000) \\n+6($6,000) \\n+7($7,000) \\n+8($8,000) \\n+9($9,000) \\n+10($10,000)\",\"REFILL\",\"CLOSE\");
   }
   if(listitem == 1)
   {
       ShowPlayerDialog(playerid,repdialog,2,\"\"lyellow\"REPAIR VEHICLE\",\"Medium repair($25,000) \\nFull Repair($55,000)\",\"REPAIR\",\"CLOSE\");
   }
}
if(dialogid == fueldialog)
{
    if(!response) return 0;
    new engine,lights,alarm,doors,bonnet,boot,objective,veh = GetPlayerVehicleID(playerid);
   GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
    if(listitem == 0)
    {
        if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 10;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-1000);
   }
        if(listitem == 1)
    {
        if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 20;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-2000);
   }
        if(listitem == 2)
    {
        if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 30;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-3000);
   }
    if(listitem == 3)
    {
        if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 400;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
      }
      SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-4000);
   }
        if(listitem == 4)
    {
        if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 50;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-5000);
   }
        if(listitem == 5)
    {
        if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 60;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-6000);
   }
   if(listitem == 6)
    {
        if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 70;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-7000);
   }
   if(listitem == 7)
    {
        if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 80;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-8000);
   }
   if(listitem == 8)
    {
        if(GetPlayerMoney(playerid) < 9000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 90;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-9000);
   }
   if(listitem == 9)
    {
        if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money!\");
        fuel[GetPlayerVehicleID(playerid)] += 100;
        if(fuel[GetPlayerVehicleID(playerid)] > 100)
        {
            fuel[GetPlayerVehicleID(playerid)] = 100;
            }
            SetVehicleParamsEx(veh,1,lights,alarm,doors,bonnet,boot,objective);
            GivePlayerMoney(playerid,-10000);
   }
}
if(dialogid == repdialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
            if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money! You need $25,000\");
            SetVehicleHealth(playerid,GetPlayerVehicleID(playerid)+300);
      SendClientMessage(playerid,green,\"» Your vehicle has been mediumly repaired for $25,000!\");
      GivePlayerMoney(playerid,-25000);
   }
   if(listitem == 1)
   {
       if(GetPlayerMoney(playerid) < 55000) return SendClientMessage(playerid,red,\"ERROR: \"lgrey\"You do not have enough money! You need $55,000\");
       RepairVehicle(GetPlayerVehicleID(playerid));
       SendClientMessage(playerid,green,\"» Your vehicle has been completely repaired for $55,000!\");
       GivePlayerMoney(playerid,-55000);
   }
}
if(dialogid == Assidialog)
{
    if(!response) return 0;
    if(listitem == 0)
    {
      if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,\"\"lred\"You must be in a \"lgreen\"vehicle\"lred\"!\");
      new currentveh;
           new Float:angle;
           currentveh = GetPlayerVehicleID(playerid);
           GetVehicleZAngle(currentveh, angle);
           SetVehicleZAngle(currentveh, angle);
           SendClientMessage(playerid, red, \"\"lred\"Your vehicle \"lorange\"has \"lred\"been \"lgreen\"flipped\"lred\"!\");
   }
        if(listitem == 1)
        {
            if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,\"\"lred\"You must be in a \"lgreen\"vehicle\"lred\"!\");
            ShowPlayerDialog(playerid,repdialog,2,\"\"lyellow\"REPAIR VEHICLE\",\"Medium repair($25,000) \\nFull Repair($55,000)\",\"REPAIR\",\"CLOSE\");
   }
   if(dialogid == 2)
   {
       new string[200];
        if(PInfo[playerid][beenrescued] == 1) return SendClientMessage(playerid,red,\"You have been recently rescued!\");
      if(PInfo[playerid][rescue] == 1) return SendClientMessage(playerid,red,\"You have recently requested a SOS rescue!\");
      PInfo[playerid][rescue] = 1;
      PInfo[playerid][beenrescued] = 0;
      format(string,sizeof(string),\"» %s(ID:%d) is in trouble! (Check red marker on the map)\",GetPName(playerid),playerid);
      SendAssistanceMessage(red,string);
      SendAssistanceMessage(red,\"Assistance cmds: /fuelcar\");
      for(new i = 0;i < MAX_PLAYERS;i++)
      {
          if(IsPlayerConnected(i))
          {
             if(gTeam == TEAM_ASSISTANCE)

             {


                SetPlayerMarkerForPlayer(playerid,i,red);


            }


         }


      }


      SendClientMessage(playerid,red,\"» Assistance called, please stay where you are!\");


      CanUseRescue[playerid] = SetTimerEx(\"Canuserescue\",20000,true,\"i\",playerid);


   }


}


if(dialogid == phonedialog)


{


    new string[150];


    if(!response) return 0;


    //if(sscanf(inputtext,\"u\",id)) return SendClientMessage(playerid,red,\"Please insert a id\") && ShowPlayerDialog(playerid,phonedialog,1,\"Phone\",\"Who would you like to phone? Insert the player\'s id/nickname\",\"Call\",\"Cancel\");


   if(PInfo[strval(inputtext)][hasphone] == 0) return SendClientMessage(playerid,red,\"That player doesn\'t have a phone!\");


   if(PInfo[playerid][called] != -1) return SendClientMessage(playerid,red,\"You are already in a call\");


   SendClientMessage(playerid,orange,\"Calling...\");


   format(string,sizeof(string),\"\"lorange\"RING... \"lyellow2\"%s \"lgreen\"is trying to call you! \"lblue\"/answer\",GetPName(playerid));


   SendClientMessage(strval(inputtext),red,string);


   PInfo[strval(inputtext)][called] = playerid;


   PInfo[playerid][called] = strval(inputtext);


    }


return 1;


}


public OnPlayerClickPlayer(playerid, clickedplayerid, source)


{


return 1;


}[/pawn]


ere gondolsz?
« Utoljára szerkesztve: 2011. december 04. - 20:00:40 írta N@rbirock »

Szöveg hiba
« Válasz #18 Dátum: 2011. december 04. - 20:00:11 »
0 Show voters
de mi lehet a baj?

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Szöveg hiba
« Válasz #19 Dátum: 2011. december 04. - 20:05:36 »
0 Show voters
Próbáld meg a scriptet a módba beletenni!

Szöveg hiba
« Válasz #20 Dátum: 2011. december 04. - 21:00:03 »
0 Show voters
D:\\Trucking_Server_2.0\\gamemodes\\Trucking.pwn(3764) : error 021: symbol already defined: \"OnDialogResponse\"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
1 Error.

 
[pawn]public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{[/pawn]
error

Szöveg hiba
« Válasz #21 Dátum: 2011. december 04. - 21:01:41 »
0 Show voters
Már létre van hozva a [pawn]public OnDialogResponse(playerid, dialogid, response, listitem, inputtext&#91;])[/pawn]
Elég egyszer létrehozni.

Nem elérhető Benceee

  • 4785
    • Profil megtekintése
Szöveg hiba
« Válasz #22 Dátum: 2011. december 05. - 19:51:53 »
0 Show voters
[mod]A téma alapvetõ kérdése megoldva. Zárok![/mod]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal