• Welcome to Vice City Multiplayer.
 

Static help needed! I am making scripts gups v5

Started by Terminatorupgrade 2, November 01, 2010, 10:30:04 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Terminatorupgrade 2

hey i need help
i am a pawno scripter aOh i am a pawno Noob
i am king this script
!superheal
in this script i need to get cost 500

Quoteelse if (strcmp(cmd, "!superheal", true) == 0) {
        else var %cost = 1000;
      new Float:Health; GetPlayerHealth(playerid,Health);
      new snick[256], plr, health[256], armour[256], szMsg[256];
       snick = strtok(cmdtext, idx), plr = FindPlayerIDFromString(snick), armour = strtok(cmdtext, idx), health = strtok(cmdtext, idx);
      SetPlayerHealth(playerid,100.0);
      SetPlayerArmour(playerid,100.0);
      SetVehicleHealth(playerid,1000.0);
        SendClientMessage(playerid,COLOR_GREEN,"You have been Supered Healed.");
        return 1;

i need help to fix it

nacho_gb1

#1
hi  ,
if (strcmp(cmdtext, "/superheal", true)==0)
{
       new Float:Health; GetPlayerHealth(playerid,Health);
SetPlayerHealth(playerid,100.0);
       SetPlayerArmour(playerid,100.0);
       SetVehicleHealth(playerid,1000.0);
       GivePlayerMoney(playerid,-500); //Change 500 for the money you want to remove it using this command
SendClientMessage(playerid,COLOR_GREEN,"You have been Supered Healed.");
return 1;
}


I think it is to, sorry for my bad English

or

if (strcmp(cmdtext, "/superheal", true)==0)
{
        new Float:Health; GetPlayerHealth(playerid,Health);
SetPlayerHealth(playerid,100.0);
        SetPlayerArmour(playerid,100.0);
        GivePlayerMoney(playerid,-500); //Change 500 for the money you want to remove it using this command
SendClientMessage(playerid,COLOR_GREEN,"You have been Supered Healed.");
if(IsPlayerInAnyVehicle(playerid))
    {
SetVehicleHealth(playerid,1000.0);
        GivePlayerMoney(playerid,-500); //Change 500 for the money you want to remove it using this command
SendClientMessage(playerid,COLOR_GREEN,"You have been Supered Healed.");
}
return 1;
}


Any failure Own, "correction" Pliz

Saludos,Desde Chile

Terminatorupgrade 2

#2
Thanks ~ ;D ;D ;D ;D ;D ;D ;D ;D for fail

/superheal is not working
i have modified it to !superheal but it is not costing

nacho_gb1

ejejejej Sorry ,  I come from samp and pawno script for samp,and do not use the sign !   :P :P .

if (strcmp(cmdtext, "!superheal", true)==0)

is so?

Saludos

Terminatorupgrade 2

#4
working but not costing ??? ??? :o :o :o





anyway big thanks be happy ;) :D :D :D

Terminatorupgrade 2


Terminatorupgrade 2

Quoteif (strcmp(cmdtext, "/superheal", true)==0)
   {
        new Float:Health; GetPlayerHealth(playerid,Health);
      SetPlayerHealth(playerid,100.0);
        SetPlayerArmour(playerid,100.0);
        SetVehicleHealth(playerid,1000.0);
        GivePlayerMoney(playerid,-500); //Change 500 for the money you want to remove it using this command
      SendClientMessage(playerid,COLOR_GREEN,"You have been Supered Healed.");
      return 1;
   }


instead of this use

Quoteif (strcmp(cmdtext, "!superheal", true)==0)
   {
        new Float:Health; GetPlayerHealth(playerid,Health);
      SetPlayerHealth(playerid,100.0);
      SetPlayerArmour(playerid,100.0);
        SetVehicleHealth(playerid,1000.0);
        if (GetPlayerMoney(playerid) > 500) DecPlayerHandCash(playerid,500);
      SendClientMessage(playerid,COLOR_GREEN,"You have been Supered Healed.");
      return 1;
   }

code changed
QuoteGivePlayerMoney(playerid,-500); //Change 500 for the money you want to remove it using this command
to
Quoteif (GetPlayerMoney(playerid) > 500) DecPlayerHandCash(playerid,500);

hahha i made it myself thanks god

nacho_gb1

DecPlayerHandCash?  :o :o

what  function hace??

Saludos

Terminatorupgrade 2


Madara

if you wannna, you can also use this:

Quote
    if (strcmp(cmdtext, "!superheal", true)==0) {
          new msn[256],Float:Health, Float:Armour, money;
            GetPlayerHealth(playerid,Health), GetPlayerArmour(playerid, Armour), money = GetPlayerHandCash(gPlayers[playerid]);
          if(GetPlayerState(playerid) == 2) {
                new Float:armveh; GetVehicleHealth(GetPlayerVehicleID(playerid),armveh);
                if (money < 500) {
               format(msn,256,"** [Error] >> You have $ %d in Cash, Need $ %d more for Superheal.",money, 500 - money);
                SendClientMessage(playerid,0x33AA33AA,msn);
            }
            else if( armveh == 1000 ) SendClientMessage(playerid,0x33AA33AA,"* [Error] >> You Vehicle have 100% HP , don't need it.");
                else {
                     SetPlayerHealth(playerid,100.0);
                   SetPlayerArmour(playerid,100.0);
                SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
                SetVehicleTyre(GetPlayerVehicleID(playerid),1);
                   SendClientMessage(playerid,0x33AA33AA,"** pm >> You have been Supere Healed in you Vehicle.");
                   DecPlayerHandCash(playerid,500);
            }
           }
           else {
           if(GetPlayerState(playerid) == 1) {
                if (money < 500) {
                format(msn,256,"** [Error] >> You have $ %d in Cash, Need $ %d more for Superheal.",money, 500 - money);
                   SendClientMessage(playerid,0x33AA33AA,msn);
            }
             else if( ( Health == 100 ) && ( Armour == 100 ) ) SendClientMessage(playerid,0x33AA33AA,"* [Error] >> You have 100% HP and 100% ARM, don't need it.");
            else {
                SetPlayerHealth(playerid,100.0);
                    SetPlayerArmour(playerid,100.0);
                    SendClientMessage(playerid,0x33AA33AA,"** pm >> You have been Supere Healed.");
                    DecPlayerHandCash(playerid,500);
                    }
          }
      }
    return 1;
    }

Terminatorupgrade 2

Madara thanks!                                                                                                                                                                                                                                                                                                                             

Terminatorupgrade 2

hi BAN system is not working

Quoteelse if (strcmp(cmd, "ban", true) == 0) {
      new szMsg[256], reason[256], plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp), reason = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"ban")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
      else if (!strlen(reason)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c ban [Nick/ID] [Reason]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else {
         new string[256],IP[256];
         format(file, sizeof(file), BANS_FILE, gPlayers[plr]);
         format(szMsg,sizeof(szMsg),"Admin %s Banned player:[ %s ] Reason:[ %s ]",gPlayers[playerid],gPlayers[plr],cmdtext[strlen(tmp)+5]);
         SendClientMessageToAll(COLOR_GREEN,szMsg);

         GetPlayerIp(playerid,IP,256);
         format(string,256,"%s",IP);
         dini_Create(file);
         dini_Set(file, "Login", "0");
         dini_Set(file, "Ip", string);
         dini_Set(file, "BannedBy", gPlayers[playerid]);
         dini_Set(file, "Reason", cmdtext[strlen(tmp)+5]);
         Ban(plr);
      }
      return 1;
   }
plz help to correct it plz

Technohopper


Terminatorupgrade 2


Madara

in Pawn, has bugs, but you can make one, it's easy to do.   ::)