How to tell pawno to do nothing?
#1

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.
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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?
Reply
#5

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"
Reply
#6

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

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.
Reply
#8

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

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;
}
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)