All pastes #549374 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-08 02:59 UTC
rendered paste body
	if (strcmp(cmd, "/god", true)==0)
	{
	    new tmp[256], string[256];
		tmp = strtok(cmdtext, idx);

		if(!strlen(tmp)) {
  			if(gGod[playerid] == 1){
  			    format(string, sizeof(string), "Godmode of %s is now turned OFF", gName[playerid]);
				SendClientMessage(playerid, COLOR_SYSTEM, string);
				gGod[playerid] = 0;
				SetPlayerHealth(playerid, 100);
			} else {
  			    format(string, sizeof(string), "Godmode of %s is now turned ON", gName[playerid]);
		  		SendClientMessage(playerid, COLOR_SYSTEM, string);
		   		gGod[playerid] = 1;
				SetPlayerHealth(playerid, 9999999999);
			}
			return 1;
		} else {
			if(FindUser(tmp)){
      			new id = GiveID(tmp);
			    if(gGod[id] == 1){
  			    	format(string, sizeof(string), "Godmode of %s is now turned OFF", gName[id]);
				    SendClientMessage(playerid, COLOR_SYSTEM, string);
				    gGod[id] = 0;
				    SetPlayerHealth(id, 100);
				} else {
  			    	format(string, sizeof(string), "Godmode of %s is now turned ON", gName[id]);
	  			    SendClientMessage(playerid, COLOR_SYSTEM, string);
	   				gGod[id] = 1;
					SetPlayerHealth(id, 9999999999);
				}
			} else {
  				format(string, sizeof(string), "Godmode target not found or multiple targets found (%s)", tmp);
  			    SendClientMessage(playerid, COLOR_SYSTEM, string);
			}
		}
		return 1;
	}