SA-MP Forums Archive
Problem ? /god - 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: Problem ? /god (/showthread.php?tid=409681)



[REP+]Problem ? /god - ahmad95 - 22.01.2013

Problem Solved.


Re: Problem ? /god - mendax - 22.01.2013

Код:
CMD:god(playerid)
{
    if(P_DATA[playerid][P_Registered] == 0) return ShowInfoTD(playerid, "~r~~h~You must be registered by using /register before using this command.");
	if(P_DATA[playerid][P_LoggedIn] == 0) return 1;
	if(P_DATA[playerid][P_God] == 0) {
		P_DATA[playerid][P_God] = 1;
		SetPlayerHealth(playerid, 9999999);
        ResetPlayerWeapons(playerid);
        ShowInfoTD(playerid,"~p~Godmode~g~ ON~p~.");
	}else if(P_DATA[playerid][P_God] == 1) {
        if(P_DATA[playerid][P_God] == 0)
        ShowInfoTD(playerid,"~p~Godmode~r~ OFF~p~.");
		SetPlayerHealth(playerid, 100);
    }
    return 1;
}



Re: Problem ? /god - Mr.Anonymous - 22.01.2013

There was a problem with GOD variable.

pawn Код:
CMD:god(playerid)
{
    if(P_DATA[playerid][P_God] == 0)
    {
        P_DATA[playerid][P_God] = 1;
      if(P_DATA[playerid][P_Registered] == 0)if(P_DATA[playerid][P_Registered] == 0) return ShowInfoTD(playerid, "~r~~h~You must be registered by using /register before using this command.");
      if(P_DATA[playerid][P_LoggedIn] == 0) return 1;
        SetPlayerHealth(playerid, 9999999);
        ResetPlayerWeapons(playerid);
        ShowInfoTD(playerid,"~p~Godmode~g~ ON~p~.");
    }
    else if(P_DATA[playerid][P_God] == 1)
    {
        P_DATA[playerid][P_God] = 0;
        ShowInfoTD(playerid,"~p~Godmode~r~ OFF~p~.");
        SetPlayerHealth(playerid, 100);
    }
    return 1;
}



Re: Problem ? /god - ahmad95 - 23.01.2013

Thx guys for the helps