Something simple i cant figer out -.- -
<Weponz> - 25.10.2010
I want it so it send a message to player if thay are not in the team that can only use it..
Код:
if(!strcmp(cmdtext,"/rpg",true)) if(gTeam[playerid] != CLASS_MERC)
{
weptimer[playerid] =120;
if(weptimer[playerid]) return SendClientMessage(playerid,RED,"[ATT]:Please Wait Before Using This Command Again!");
GivePlayerWeapon(playerid, 35, 50);
SendClientMessage(playerid, RED, "[ATT]: RPG Recieved With 50 Rockets!");
return 1;
}
This does nothing..
Код:
if(!strcmp(cmdtext,"/rpg",true)) if(gTeam[playerid] != CLASS_MERC)
{
weptimer[playerid] =120;
if(weptimer[playerid]) return SendClientMessage(playerid,RED,"[ATT]:Please Wait Before Using This Command Again!");
GivePlayerWeapon(playerid, 35, 50);
SendClientMessage(playerid, RED, "[ATT]: RPG Recieved With 50 Rockets!");
else SendClientMessage(playerid, RED, "[ATT]: You Cant Use This Command!");//Addition
return 1;
}
Any Help
Re: Something simple i cant figer out -.- -
BMUK - 25.10.2010
pawn Код:
if(!strcmp(cmdtext,"/rpg",true))
{
if(gTeam[playerid] != CLASS_MERC) return SendClientMessage(playerid,RED,"Error Message!"); // He is NOT in CLASS_MERC
if(weptimer[playerid]) return SendClientMessage(playerid,RED,"[ATT]:Please Wait Before Using This Command Again!");
weptimer[playerid] =120; // This needs to go below the check above
GivePlayerWeapon(playerid, 35, 50);
SendClientMessage(playerid, RED, "[ATT]: RPG Recieved With 50 Rockets!");
return 1;
}
You could have worked that out :P
Re: Something simple i cant figer out -.- -
SampStunta - 25.10.2010
Try using the search bar in the future :S
Re: Something simple i cant figer out -.- -
Scenario - 25.10.2010
* You should also use a better command processor...
Re: Something simple i cant figer out -.- -
Kyle - 25.10.2010
Coded it in DCMD for you!
pawn Код:
dcmd_rpg(playerid, params[])
{
#pragma unused params
if(gTeam[playerid] != CLASS_MERC) return SendClientMessage(playerid,RED,"Error Message!");
if(weptimer[playerid]) return SendClientMessage(playerid,RED,"[ATT]:Please Wait Before Using This Command Again!");
GivePlayerWeapon(playerid, 35, 50);
SendClientMessage(playerid, RED, "[ATT]: RPG Recieved With 50 Rockets!");
weptimer[playerid] =120;
return 1;
}
Re: Something simple i cant figer out -.- -
<Weponz> - 25.10.2010
Quote:
Originally Posted by KyleSmith
Coded it in DCMD for you!
pawn Код:
dcmd_rpg(playerid, params[]) { #praagm unused params if(gTeam[playerid] != CLASS_MERC) return SendClientMessage(playerid,RED,"Error Message!"); if(weptimer[playerid]) return SendClientMessage(playerid,RED,"[ATT]:Please Wait Before Using This Command Again!"); GivePlayerWeapon(playerid, 35, 50); SendClientMessage(playerid, RED, "[ATT]: RPG Recieved With 50 Rockets!"); weptimer[playerid] =120; return 1; }
|
Wow...DCMD looks...so...SIMILAR NOW! :O...Ahh but what is #praagm and why is it there>?
Plus what do i need to run DCMD...Might as well convert it now while i have it a 1000 lines xD
Re: Something simple i cant figer out -.- -
Kyle - 25.10.2010
I used pragma because I dont use any commands like, /rpg (id)
Etc, But if I was to use it Id use scanf to do it.
There are a few tutorials out there, Take a look.
Re: Something simple i cant figer out -.- -
Scenario - 25.10.2010
Quote:
Originally Posted by KyleSmith
I used pragma because I dont use any commands like, /rpg (id)
Etc, But if I was to use it Id use scanf to do it.
There are a few tutorials out there, Take a look.
|
That explained nothing about why you used "#pragma unused params" in the code... As you can see in the line below, "params" exists, which could be used for making a command (for example) /kick [playerid] [reason], etc... If you only have a command like (for example) /help, which brings up a dialog you aren't using any "params" there. So it's best to tell the script; "Hey! No params exist in this command, so don't even check!". Make sense?
pawn Код:
dcmd_rpg(playerid, params[])
Re: Something simple i cant figer out -.- -
Kyle - 25.10.2010
Yes, I dont proof read to check what I typed lol.
Re: Something simple i cant figer out -.- -
BMUK - 25.10.2010
Worst "I'm a noob" excuse EVAR!