SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 28/07/2013, 12:34 PM   #1
QatarKnight
Big Clucker
 
Join Date: Jul 2013
Posts: 95
Reputation: -11
Default How to tell pawno to do nothing?

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.
QatarKnight is offline   Reply With Quote
Old 28/07/2013, 12:36 PM   #2
GuyYahood1
Big Clucker
 
Join Date: Dec 2010
Posts: 151
Reputation: 6
Default Re: How to tell pawno to do nothing?

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;
}
__________________
GuyYahood1 is offline   Reply With Quote
Old 28/07/2013, 12:39 PM   #3
QatarKnight
Big Clucker
 
Join Date: Jul 2013
Posts: 95
Reputation: -11
Default Re: How to tell pawno to do nothing?

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.
QatarKnight is offline   Reply With Quote
Old 28/07/2013, 12:46 PM   #4
GuyYahood1
Big Clucker
 
Join Date: Dec 2010
Posts: 151
Reputation: 6
Default Re: How to tell pawno to do nothing?

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?
__________________
GuyYahood1 is offline   Reply With Quote
Old 28/07/2013, 12:55 PM   #5
QatarKnight
Big Clucker
 
Join Date: Jul 2013
Posts: 95
Reputation: -11
Default Re: How to tell pawno to do nothing?

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"
QatarKnight is offline   Reply With Quote
Old 28/07/2013, 12:56 PM   #6
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: How to tell pawno to do nothing?

pawn Code:
#define INFINITY (Float:0x7F800000)
pawn Code:
// Somewhere:
SetPlayerHealth(playerid, INFINITY);
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 28/07/2013, 12:58 PM   #7
QatarKnight
Big Clucker
 
Join Date: Jul 2013
Posts: 95
Reputation: -11
Default Re: How to tell pawno to do nothing?

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 (c) 1997-2006, ITB CompuPhase


1 Error.
QatarKnight is offline   Reply With Quote
Old 28/07/2013, 01:04 PM   #8
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: How to tell pawno to do nothing?

Show the lines 2562, 2563, 2564. Are you sure, it's inside a callback?
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 28/07/2013, 01:07 PM   #9
QatarKnight
Big Clucker
 
Join Date: Jul 2013
Posts: 95
Reputation: -11
Default Re: How to tell pawno to do nothing?

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;
}
QatarKnight is offline   Reply With Quote
Old 28/07/2013, 01:24 PM   #10
Binx
Big Clucker
 
Join Date: Jul 2013
Posts: 108
Reputation: 2
Default Re: How to tell pawno to do nothing?

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;
}
__________________
Donít argue with idiots because they will drag you down to their level and then beat you with experience.
- Greg King.
Binx is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Pawno StoleArsov Scripting Help 3 05/02/2013 08:49 PM
Pawno bug? Littlehelper Scripting Help 3 24/07/2012 10:20 AM
Help With Pawno Jing_Chan Help Archive 6 03/02/2011 04:56 PM
Pawno Help Nikoz Help Archive 2 25/01/2011 02:58 AM
Help With Pawno Needed I Changes The Name Becouse it Is Unleading It Was Pawno zzarzzur Help Archive 3 29/01/2010 03:50 AM


All times are GMT. The time now is 07:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.