/ command not working
#1

ok guys i got this script from the web yo make a player a vampire command is /makevampire ex.jack you must login rcon to use this command but i try to make myself a vamp and it dont work. was thinking could we script a check point that truns anyone that walks in it into a vampire? heres the full script i downloded

pawn Код:
// In this script you will can become a vampire.... :D
//Includes
#include <a_samp>
#include <Colors>
#include <foreach>
#include <zcmd>
#include <sscanf2>

#define BLOOD_DIALOG 125

#pragma tabsize 0

//Variables
new Vampire[MAX_PLAYERS];

forward MakeVampire(id);
forward IfDay(id);
forward IncreaseTime();

new hour = 0, minutes = 0;

new VTimer;
new DTimer;

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Vampire Script by XStormiest....! Loaded");
    print("--------------------------------------\n");
   
    SetTimer("IncreaseTime",1000,true);
    return 1;
}

public OnFilterScriptExit()
{
        print("\n--------------------------------------");
    print("Vampire Script by XStormiest....! UnLoaded");
    print("--------------------------------------\n");
    return 1;
}

public OnPlayerConnect(playerid)
{
     Vampire[playerid] = 0;
     SendClientMessage(playerid,COLOR_BLUE,"This server include a vampire script created by XStormiest: /vahelp");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
   Vampire[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
      if(Vampire[playerid] == 1)
      {
             SendClientMessage(playerid,COLOR_BLUE,"You are no more an Vampire!");
             Vampire[playerid] = 0;
             KillTimer(DTimer);
      }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

public MakeVampire(id)
{
      SetPlayerWeather(id,2);
      KillTimer(VTimer);
   return 1;
}
public IncreaseTime()
{
    foreach(Player,i)
    {
           minutes += 1;
           if(minutes == 60)
           {
               hour += 1;
               minutes -= 60;
                  if(Vampire[i] == 1)
                  {
                                new string[256];
                                format(string,sizeof(string),"Warning! Hour: %d Minutes:%d!! daylight will kill you and if you die you will become human again!!");
                                SendClientMessage(i,COLOR_GREEN,string);
                  }
           }
           //I removed SetPlayerTime(playerid,hour,minutes); because will want to this script will set the time and this is not good for some servers...
    }
   return 1;
}
public IfDay(id)
{
     new Float:HP;
    GetPlayerHealth(id,HP);
    if(Vampire[id] == 1)
    {
         if(hour > 5 || hour < 10)
         {
             SetPlayerHealth(id,HP-1);
         }
         else
        {
                if(!IsPlayerInRangeOfPoint(id,20,1563.6803,-1755.0962,4.6464) )
                {
                }
                else
                {
                              SetPlayerHealth(id,HP+1);
                               if(HP == 100) return SetPlayerHealth(id,100);
                }
        }
    }
    return 1;
}

//Comands
    CMD:vahelp(playerid,params[])
    {
          new string[256];
          strcat(string,"/vabite - make an another player vampire\n");
          strcat(string,"/makevampire - make player a vampire ( only RCON)\n");
          strcat(string,"/vabloodbuy - must be in the vampires secret area\n");
          strcat(string,"/vakill - kill a player sucking all his/her blood\n");
          strcat(string,"/vasuck - suck a player blood ( must write amount of blood)\n");
          ShowPlayerDialog(playerid,126,DIALOG_STYLE_MSGBOX,"Vampire Help",string,"Ok","");
          return 1;
    }
    CMD:makevampire(playerid,params[])
    {
                        new id;
            if(sscanf(params,"u",id) ) return SendClientMessage(playerid,COLOR_RED,"[USAGE]: /makevampire [id]");
            if(!IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"You are not an RCON Admin!");
            if(Vampire[id] == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is already vampire");
            if(!IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
               else
               {
                        new name[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid,name,sizeof(name));
                        GetPlayerName(id,playername,sizeof(playername));
                       new gstring[256], string[256];

                       format(string,sizeof(string),"Admin  %s maked you as a vampire, you are now a vampire!",playername);
                       format(gstring,sizeof(gstring),"You have been transformed into a Vampire by Admin %s",name);

                       SendClientMessage(playerid,COLOR_BLUE,string);
                       SendClientMessage(id,COLOR_GREEN,gstring);
                       SetPlayerWeather(id,-2);
                         Vampire[id] = 1;
                        VTimer = SetTimerEx("MakeVampire",5000,false,"u",id);
                         DTimer = SetTimerEx("IfDay",60*1000,true,"u",id);
               }
        return 1;
    }
    CMD:vabite(playerid,params[])
    {
            new id, Float:iX,Float:iY,Float:iZ;
            GetPlayerPos(id,iX,iY,iZ);
            if(sscanf(params,"u",id) ) return SendClientMessage(playerid,COLOR_RED,"[USAGE]: /vabite [id]");
            if(Vampire[playerid] != 1 || Vampire[id] == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is already a vampire or you are not a vampire!");
            if(!IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
            if(!IsPlayerInRangeOfPoint(playerid,5,iX,iY,iZ) ) return SendClientMessage(playerid,COLOR_RED,"You must be in range of player to use this!!");
               else
               {
                        new name[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid,name,sizeof(name));
                        GetPlayerName(id,playername,sizeof(playername));
                       new gstring[256], string[256];
                       
                       format(string,sizeof(string),"You bited %s, he is now a vampire!",playername);
                       format(gstring,sizeof(gstring),"You had been bitten by vampire %s",name);
                       
                       SendClientMessage(playerid,COLOR_BLUE,string);
                       SendClientMessage(id,COLOR_GREEN,gstring);
                       SetPlayerWeather(id,-2);
                         Vampire[id] = 1;
                        VTimer = SetTimerEx("MakeVampire",5000,false,"u",id);
                         DTimer = SetTimerEx("IfDay",60*1000,true,"u",id);
               }
         return 1;
    }
    CMD:vakill(playerid,params[])
    {
            new id, Float:iX,Float:iY,Float:iZ;
            GetPlayerPos(id,iX,iY,iZ);
            if(sscanf(params,"u",id) ) return SendClientMessage(playerid,COLOR_RED,"[USAGE]: /vakill [id]");
            if(Vampire[playerid] != 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: you are not a vampire!");
            if(!IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
            if(!IsPlayerInRangeOfPoint(playerid,5,iX,iY,iZ) ) return SendClientMessage(playerid,COLOR_RED,"You must be in range of player to use this!!");
               else
               {
                        new name[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid,name,sizeof(name));
                        GetPlayerName(id,playername,sizeof(playername));
                       new gstring[256], string[256];

                       format(string,sizeof(string),"You killed %s, he had no blood and died!",playername);
                       format(gstring,sizeof(gstring),"You had been killed by vampire %s",name);

                       SendClientMessage(playerid,COLOR_BLUE,string);
                       SendClientMessage(id,COLOR_GREEN,gstring);
                       SetPlayerHealth(id,0);
               }
         return 1;
    }
    CMD:vbloodbuy(playerid,params[])
    {
         if(!IsPlayerInRangeOfPoint(playerid,10,1563.6803,-1755.0962,4.6464) ) return SendClientMessage(playerid,COLOR_RED,"You must be here to buy blood!!");
         if(Vampire[playerid] != 1) return SendClientMessage(playerid,COLOR_GREEN,"You are not an Vampire");
         else
         {
              ShowPlayerDialog(playerid,BLOOD_DIALOG,DIALOG_STYLE_LIST,"Buy and Drink Blood","2L Blood( + 25 blood - 4.500$)\n5L Blood( + 50 Blood - 10.500$)\n10L(MAX HP - 20.500$)","Buy/Drink","Cancel");
         }
         return 1;
    }
    CMD:vasuck(playerid,params[])
    {
            new id ,amount, Float:iX,Float:iY,Float:iZ;
            new Float: Health;
            GetPlayerPos(id,iX,iY,iZ);
            if(sscanf(params,"ud",id,amount) ) return SendClientMessage(playerid,COLOR_RED,"[USAGE]: /vasuck [id]");
            if(Vampire[playerid] != 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: you are not a vampire!");
            if(!IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
            if(!IsPlayerInRangeOfPoint(playerid,5,iX,iY,iZ) ) return SendClientMessage(playerid,COLOR_RED,"You must be in range of player to use this!!");
               else
               {
                       GetPlayerHealth(id,Health);
                        new name[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid,name,sizeof(name));
                        GetPlayerName(id,playername,sizeof(playername));
                       new gstring[256], string[256];

                       format(string,sizeof(string),"You drain %s: %d blood!",playername,amount);
                       format(gstring,sizeof(gstring),"Your blood has been drained by vampire %s",name);

                       SendClientMessage(playerid,COLOR_BLUE,string);
                       SendClientMessage(id,COLOR_GREEN,gstring);
                       
                       SetPlayerHealth(id,Health-amount);
                        SetPlayerHealth(playerid,Health+amount);
               }
         return 1;
    }
/////////

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
       new Float: HP;
       GetPlayerHealth(playerid,HP);
       
       
       if(dialogid == BLOOD_DIALOG)
       {
             if(!response) return 1;
             if(response)
             {
                   if(HP == 100) return SendClientMessage(playerid,COLOR_RED,"You can't buy hp, you have max hp!");
                   else
                   {
                         if(listitem == 0)
                         {
                              if(GetPlayerMoney(playerid) >= 4500)
                              {
                                    GivePlayerMoney(playerid,-4500);
                                    SetPlayerHealth(playerid,HP+25);
                                     if(HP == 100) return SetPlayerHealth(playerid,100);
                                    SendClientMessage(playerid,COLOR_YELLOW,"HP succesfully purchased!!");
                              }
                              else SendClientMessage(playerid,COLOR_GREEN,"You don't have enough money!");
                         }
                         if(listitem == 1)
                         {
                               if(GetPlayerMoney(playerid) >= 10500)
                              {
                                    GivePlayerMoney(playerid,-10500);
                                    SetPlayerHealth(playerid,HP+50);
                                    if(HP == 100) return SetPlayerHealth(playerid,100);
                                    SendClientMessage(playerid,COLOR_YELLOW,"HP succesfully bought!!");
                              }
                              else SendClientMessage(playerid,COLOR_GREEN,"You don't have enough money!");
                         }
                         if(listitem == 2)
                         {
                              if(GetPlayerMoney(playerid) >= 20500)
                              {
                                    GivePlayerMoney(playerid,-20500);
                                    SetPlayerHealth(playerid,100);
                                    SendClientMessage(playerid,COLOR_YELLOW,"HP succesfully bought!!");
                              }
                              else SendClientMessage(playerid,COLOR_GREEN,"You don't have enough money!");
                         }
                   }
             }
       }
    return 1;
}
Reply
#2

yea server is loading this sript but nothing works and should stuff like SendClientMessage(playerid,COLOR_GREEN,"You don't have enough money!");
}
i thought the color green would be a id number for the color not the color name (green)
Reply
#3

still hoping a scriptor will read over this and rewright it so it will work something makes no /commands work at all
Reply
#4

well it been looked at like 52 time i guess the script is fine so guess its just me wil pls remove this post thx
Reply
#5

pawn Код:
if(!IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"You are not an RCON Admin!");
This line check if the player is logged into rcon, and if they are not, it will return that message to the player.
To use the command you either need to remove the check or log into rcon.


Read the wiki about checkpoints and try doing it yourself before creating another thread
Reply
#6

thx man for lookingat this script i did not wright it and i dont know how to wright any script i just am trying to get it to run on my private server. i have tryed adding this script to Limitless Gaming by Syntax GM and to RuNix_Romania cops and robbers . wint i say im trying to get it to work i do not mean the checkpoint i mean the FS will not work at all need someone to read over all the FS and see why its not working pls ty. i was looking at script i dont know but looks to me like the lines

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Vampire Script by XStormiest....! Loaded");
print("--------------------------------------\n");

SetTimer("IncreaseTime",1000,true);
return 1;
}

public OnFilterScriptExit()
{
print("\n--------------------------------------");
print("Vampire Script by XStormiest....! UnLoaded");
print("--------------------------------------\n");
return 1;

are saying you have to hit a buttion to load and unload this FS ? if so what buttion ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)