SA-MP Forums Archive
Pawno not saving - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pawno not saving (/showthread.php?tid=500091)



Pawno not saving - DoomHunter - 11.03.2014

Hello when I change something to the pawno like the infinite ammo on weapons, I type /aduty and recieve non infinite ammo weapons! But I changed in the script for infinite : 0x7FFFFFFF

Код:
	 	if(strcmp(cmd, "/aduty", true) == 0)
	{
	      if(PlayerInfo[playerid][pAdmin] >= 2)
	      {
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  SetPlayerHealth(playerid, 99999999);
                  SetPlayerArmour(playerid, 99999999);
                  SendClientMessage(playerid, COLOR_YELLOW, "You are now an on-duty Administrator!");
	          format(string, sizeof(string), "%s is now on-duty Administrator. ", sendername);
	          SendClientMessageToAll(COLOR_YELLOW, string);
                  SetPlayerColor(playerid, COLOR_WHITE);
		  ResetPlayerWeapons(playerid);
		  GivePlayerWeapon(playerid, 42, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 39, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 38, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 34, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 31, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 29, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 27, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 24, 0x7FFFFFFF);
		  GivePlayerWeapon(playerid, 40, 1);
		  GivePlayerWeapon(playerid, 10, 1);
		  GivePlayerWeapon(playerid, 9, 1);
	       }
	       return 1;
I close the server, edit this and then I click save and I run the server and when i type the command it gives me weapon but not with infinite ammo!HELP!


Re: Pawno not saving - DoomHunter - 11.03.2014

Or anything else I change it goes on by the old one, not the one I edited...


Re: Pawno not saving - Stinged - 11.03.2014

You said "i click save", did you just save or did you compile it?


Re: Pawno not saving - AroseKhanNiazi - 11.03.2014

Top of Script after Includes
Код:
new oldskin[MAX_PLAYERS]; // using this aduty can make many things 
new aduty[MAX_PLAYERS];
#define SCM SendClientMessage // IS FAST and Short :D
#define COLOR_HOTPINK 0xFF00FFFF
OnPlayerConnect(playerid) // add this
Код:
aduty[playerid] =0;
oldskin[playerid] =0;
add this with your other commands

Код:
if(strcmp(cmd, "/aduty", true) == 0)
	{
        if(PlayerInfo[playerid][pAdmin] < 2) return //any message u want to send if user is not admin
        if(aduty[playerid] == 0)
        {
        new Float:dutyhp;
        new Float:dutyarmour;
        pDutyHealth[playerid] = GetPlayerHealth(playerid, dutyhp);
        pDutyArmour[playerid] = GetPlayerArmour(playerid, dutyarmour);
        SCM(playerid, COLOR_HOTPINK,"* You Have Gone On Duty.");
        SetPlayerArmour(playerid, 9999999999); // Make 99999999 and it's infinite ammo
        SetPlayerHealth(playerid, 999999);
        GivePlayerWeapon(playerid, 38, 9999999);
        //oldskin[playerid] = GetPlayerSkin(playerid);
        //SetPlayerSkin(playerid, 294); // will set the user to wozie skin
        aduty[playerid] =1;
        }
        else
        {
        SCM(playerid, COLOR_HOTPINK,"* You Have Gone Off Duty.");
        SetPlayerHealth(playerid, pDutyHealth[playerid]);
        SetPlayerArmour(playerid, pDutyArmour[playerid]);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        ResetPlayerWeapons(playerid);
        SetPlayerSkin(playerid, oldskin[playerid]);
        aduty[playerid] =0;
        //oldskin[playerid] =0; // will bring the admin back to skin if used
        GivePlayerWeapon(playerid, 9, 99999);
        GivePlayerWeapon(playerid, 14, 99999);
        GivePlayerWeapon(playerid, 16, 99999);
        GivePlayerWeapon(playerid, 24, 99999);
        GivePlayerWeapon(playerid, 26, 99999);
        GivePlayerWeapon(playerid, 28, 99999);
        GivePlayerWeapon(playerid, 31, 99999);
        GivePlayerWeapon(playerid, 26, 99999);
        GivePlayerWeapon(playerid, 34, 99999);
        GivePlayerWeapon(playerid, 38, 99999);
        GivePlayerWeapon(playerid, 46, 99999);
        }
        return 1;
}
didn't add that admin's on duty this can make hackers stop hack or be careful
i don't know how to use strcmp cmds i use zcmd

And Compile It or it will not work tell me errors in Pm


Re: Pawno not saving - DoomHunter - 11.03.2014

Mind if I give you the whole script?


Re: Pawno not saving - DoomHunter - 12.03.2014

Quote:
Originally Posted by Stinged
Посмотреть сообщение
You said "i click save", did you just save or did you compile it?
I only saved it...
I didn't compile it because I had an issue and know its even bigger...I have posted a Thread about it,Check it OUT!
LINK : http://forum.sa-mp.com/showthread.ph...46#post2950846


Re: Pawno not saving - CuervO - 12.03.2014

By the way, 0x7FFFFFFF is not infinity, infact, infinity is not even a number (whereas 7FFFFFFF is, 2147483647 the highest integer possible in PAWN)


Re: Pawno not saving - DoomHunter - 12.03.2014

Okay, thanks for your help, I will fix it as soon as I fix my whole Runtime Error 17...