Help me out with this cmd
#1

Код:
CMD:oban(playerid,params[])
{
	new string[50],string1[50];
	if(isnull(params)) return SendClientMessage(playerid,"/oban [playername]");
	format(string,sizeof(string),"Users/%s.ini",params);
    if(fexist(string))
    {
        new INI:file = INI_Open(string);
        INI_WriteInt(file,"Banned",1);
        INI_Close(file);
        format(string1,sizeof(string1),"has offline banned %s.",params);
        SendClientMessage(playerid,-1,string1);
    }
    else SendClientMessage(playerid,-1,"Account not found");
    return 1;
}
Error's
Код:
error 035: argument type mismatch (argument 2)
if there is a better offline banned cmd send it to me plz
Reply
#2

What line is the error occurring on?
Reply
#3

Код:
if(isnull(params)) return SendClientMessage(playerid,"/oban [playername]");
https://sampwiki.blast.hk/wiki/SendClientMessage
Reply
#4

Quote:
Originally Posted by FreAkeD
Посмотреть сообщение
What line is the error occurring on?
I couldn't find that

Quote:
Originally Posted by SyS
Посмотреть сообщение
Код:
if(isnull(params)) return SendClientMessage(playerid,"/oban [playername]");
https://sampwiki.blast.hk/wiki/SendClientMessage
changed it to and still not working
Код:
if(isnull(params)) return ShowUsageMessage(playerid,"/oban [playername]");
if anyone has a better offline ban cmd plz direct me to that way
Reply
#5

Quote:
Originally Posted by Xtra
Посмотреть сообщение
I couldn't find that



changed it to and still not working
Код:
if(isnull(params)) return ShowUsageMessage(playerid,"/oban [playername]");
if anyone has a better offline ban cmd plz direct me to that way
I pointed out the mistake there.See parameters of sendclientmessage
Reply
#6

Quote:
Originally Posted by SyS
Посмотреть сообщение
I pointed out the mistake there.See parameters of sendclientmessage
yes i saw that so i changed it to showusagemessage and still i got a new error

error 017: undefined symbol "ShowUsageMessage"
Reply
#7

Quote:
Originally Posted by Xtra
Посмотреть сообщение
yes i saw that so i changed it to showusagemessage and still i get error's
You can use send client message but your error is you are missing the color
Reply
#8

What...

ShowUsageMessage isn't a native SA-MP function. Sys and Dayrion both pointed out your mistake.

Your initial problem was with SendClientMessage().

Код:
if(isnull(params)) return SendClientMessage(playerid,"/oban [playername]");
Is incorrect.

Код:
if(isnull(params)) return SendClientMessage(playerid, -1, "/oban [playername]");
Is correct. -1 is where the color of the message goes.
Reply
#9

thx alot soved +Rep for everyone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)