SA-MP Forums Archive
How to tell pawno to do nothing? - 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: How to tell pawno to do nothing? (/showthread.php?tid=454307)



How to tell pawno to do nothing? - QatarKnight - 28.07.2013

I have a piece of code:

CMD:god(playerid, params[])
{
if(playerinminigame[playerid] == 1)
{
SendClientMessage(playerid, -1, "You can't use any commands in a minigame.");
}
return 1;
}

I want to make it so if they're not in minigame they can use the command /god. In other words i want to tell pawno that if they're not any minigame it does nothing.


Re: How to tell pawno to do nothing? - GuyYahood1 - 28.07.2013

Try:

CMD:god(playerid, params[])
{
if(playerinminigame[playerid]) return SendClientMessage(playerid, -1, "You can't use any commands in a minigame.");
//Here write what command do for they're not in minigame..
return 1;
}


Re: How to tell pawno to do nothing? - QatarKnight - 28.07.2013

Quote:
Originally Posted by GuyYahood1
View Post
Try:

CMD:god(playerid, params[])
{
if(playerinminigame[playerid]) return SendClientMessage(playerid, -1, "You can't use any commands in a minigame.");
//Here write what command do for they're not in minigame..
return 1;
}
The command /god is in the gamemode i want it to work if they're not in a minigame.


Re: How to tell pawno to do nothing? - GuyYahood1 - 28.07.2013

Quote:

CMD:god(playerid, params[])
{
if(playerinminigame[playerid]) return SendClientMessage(playerid, -1, "You can't use any commands in a minigame.");
//Here write what command do for they're not in minigame..
SetPlayerHealte(playerid, 1000); //For Example
return 1;
}

I signaled to you where you do the order, it will work only if they are not in minigame...
understood?


Re: How to tell pawno to do nothing? - QatarKnight - 28.07.2013

Quote:
Originally Posted by GuyYahood1
View Post
I signaled to you where you do the order, it will work only if they are not in minigame...
understood?
I want it to setplayerhealth to infinite but when i type that i get undefined symbol "infinite"


Re: How to tell pawno to do nothing? - Konstantinos - 28.07.2013

pawn Code:
#define INFINITY (Float:0x7F800000)
pawn Code:
// Somewhere:
SetPlayerHealth(playerid, INFINITY);



Re: How to tell pawno to do nothing? - QatarKnight - 28.07.2013

Quote:
Originally Posted by _Zeus
View Post
pawn Code:
#define INFINITY (Float:0x7F800000)
pawn Code:
// Somewhere:
SetPlayerHealth(playerid, INFINITY);
I get this also
C:\Users\New\Desktop\Current Server2\FunGaming Stunt-Freeroam\filterscripts\Event.pwn(2563) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: How to tell pawno to do nothing? - Konstantinos - 28.07.2013

Show the lines 2562, 2563, 2564. Are you sure, it's inside a callback?


Re: How to tell pawno to do nothing? - QatarKnight - 28.07.2013

Quote:
Originally Posted by _Zeus
View Post
Show the lines 2562, 2563, 2564. Are you sure, it's inside a callback?
CMD:god(playerid, params[])
{
if(playerinminigame[playerid] == 1)
{
SendClientMessage(playerid, -1, "You can't use any commands in a minigame.");
else SetPlayerHealth(playerid, INFINITY);
}
return 1;
}


Re: How to tell pawno to do nothing? - Binx - 28.07.2013

CMD:god(playerid, params[])
{
if(playerinminigame[playerid] == 1)
{
SendClientMessage(playerid, -1, "You can't use any commands in a minigame.");
else SetPlayerHealth(playerid, 99999);
}
return 1;
}