SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 28/08/2009, 03:57 PM   #1
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 2,929
Reputation: 700
Default Help in my command

Hello I've a little problem in mine command.

Code:
  if(strcmp(cmd, "/setallcash", true) == 0)
  {
    if(Girilmis[playerid] == 0) return Mesaj(playerid, COLOR_RED, "<!> You must login first.");
    	if(Adminlik[playerid] >= 2)
    	{
			for(new i=0; i<GetMaxPlayers(); i++)
			{
		    	tmp = strtok(cmdtext, idx);
		  	if(!strlen(tmp)) return Mesaj(playerid, COLOR_WHITE, "<Usage> /setallcash [amount]");
		  	new Miktar = strval(tmp);
		  	if(Miktar >= 0 && Miktar <= 999999999)
		  	{
			    format(string, sizeof(string), "<> Administrator %s has changed all player money to $%d.", adminisim, Miktar);
			    HerkezeMesaj(COLOR_PURPLE, string);
			    SetPlayerMoney(i, Miktar);
				}
				else
				{
				  Mesaj(playerid, COLOR_RED, "<!> invalid amount.");
				}
				}
		}
		else
		{
 			Mesaj(playerid, COLOR_RED,"<!> You don't have level enough!");
		}
		return 1;
  }
when I type /setallcash 100 oke it will sets all cash to 100$ but It will also display a mesage with: '<Usage> /Setallcash [amount]' but I gived the ammount :S
__________________

Sup?
RyDeR` is offline  
Old 28/08/2009, 04:29 PM   #2
ded
Gangsta
 
ded's Avatar
 
Join Date: Jun 2009
Location: We comin' through dumpin'
Posts: 543
Reputation: 0
Default Re: Help in my command

Code:
if(strcmp(cmd, "/setallcash", true) == 0)
  {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return Mesaj(playerid, COLOR_WHITE, "<Usage> /setallcash [amount]");
    if(Girilmis[playerid] == 0) return Mesaj(playerid, COLOR_RED, "<!> You must login first.");
    	if(Adminlik[playerid] >= 2)
    	{
			for(new i=0; i<GetMaxPlayers(); i++)
            {
		  	new Miktar = strval(tmp);
		  	if(Miktar >= 0 && Miktar <= 999999999)
		  	{
			    format(string, sizeof(string), "<> Administrator %s has changed all player money to $%d.", adminisim, Miktar);
			    HerkezeMesaj(COLOR_PURPLE, string);
			    SetPlayerMoney(i, Miktar);
				}
				else
				{
				  Mesaj(playerid, COLOR_RED, "<!> invalid amount.");
				}
				}
		}
		else
		{
 			Mesaj(playerid, COLOR_RED,"<!> You don't have level enough!");
		}
		return 1;
  }

Try that.

Edit: BBC Code tag fucked indentation. -.- You know what to do.
__________________
ded is offline  
 

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
[Command Bugged] Each time i use /respawnallcars it says Unknown Command Rand_Omar Scripting Help 11 30/09/2012 01:35 AM
how i change wrong command (unknow command) OmarEco Help Archive 10 22/06/2010 05:09 PM
SERVER: Unknown Command when using a scripted command and it does execute! Moustafa Help Archive 6 11/06/2010 02:34 PM
Command that returns SERVER: Unknown Command. pagie1111 Help Archive 11 11/04/2010 10:55 AM
Command added but returns Unkown command hipy Help Archive 3 19/11/2009 06:11 PM


All times are GMT. The time now is 03:31 AM.


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