Help Pls [+1 Rep]
#1

Iam using SATDM v11


//================================================== ============================
// Commands
//================================================== ============================
//===================================Commands======= ============================
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success == 0)
{
SendClientMessage(playerid, COLOR_RED, "Try another command from /help, that one doesnt exist!");
return 1;
}
return 1;
}




I got these Errors:

F:\[0.3c]\SATDM~Lux\Gamemodes\SATDM_v11.pwn(9794) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandPerformed")

F:\[0.3c]\SATDM~Lux\Gamemodes\SATDM_v11.pwn(9801) : warning 217: loose indentation

Help
Get +1 Rep
Reply
#2

pawn Код:
forward OnPlayerCommandPerformed(playerid, cmdtext[], success); //at the top of script after the #include <a_samp> or after the other #includes
the loose indentation one is something about this

Код:
         SendClientMessage(playerid, -1, "Dancing party!"); //will give loose indentation in this line
SendClientMessage(playerid, -1, "Enjoying huh!");

SendClientMessage(playerid, -1, "Dancing party!"); //correct one
SendClientMessage(playerid, -1, "Enjoying huh!");
Reply
#3

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success == 0)
{
SendClientMessage(playerid, COLOR_RED, "Try another command from /help, that one doesnt exist!");
return 1;
}
return 0;
}
Try this code
Reply
#4

Quote:
Originally Posted by MichaelProPlayer
Посмотреть сообщение
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success == 0)
{
SendClientMessage(playerid, COLOR_RED, "Try another command from /help, that one doesnt exist!");
return 1;
}
return 0;
}

Try this code
This ain't gonna work. you just change return 1; to return 0; it will keep the warning better do what i say

Quote:
Originally Posted by Reklez
Посмотреть сообщение
pawn Код:
forward OnPlayerCommandPerformed(playerid, cmdtext[], success); //at the top of script after the #include <a_samp> or after the other #includes
the loose indentation one is something about this

Код:
         SendClientMessage(playerid, -1, "Dancing party!"); //will give loose indentation in this line
SendClientMessage(playerid, -1, "Enjoying huh!");

SendClientMessage(playerid, -1, "Dancing party!"); //correct one
SendClientMessage(playerid, -1, "Enjoying huh!");
Reply
#5

or just copy/paste this
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success)
    {
        new 
string[70];
        
format(stringsizeof(string), "Command %s dont exits, Type /cmds for all your commands."cmdtext);
        
SendClientMessage(playerid,COLOR_REDstring);
    }
    return 
true;

Reply
#6

Thankx +1 rep

But still one error:
F:\[0.3c]\Gamemodes\SATDM~Lux\Gamemodes\SATDM_v11.pwn(9803) : warning 217: loose indentation

This How to fix tell me!
pLease
Reply
#7

Quote:
Originally Posted by Bleach79
Посмотреть сообщение
But still one error:
F:\[0.3c]\Gamemodes\SATDM~Lux\Gamemodes\SATDM_v11.pwn(9803) : warning 217: loose indentation
thats mean your code its not at same like just copy and paste into your gm/fs (wichout anychanges on code,only change clientmessage if you wont
Reply
#8

Warnings aren't a problem at all mate, loose indentation is when you do not have the lines in the right position with the margin example:

Код:
      Send Massage
Send Massage
Send Massage
Send Massage
You have to arrange that to be:

Код:
Send Massage
Send Massage
Send Massage
Send Massage
Reply
#9

Error fixed
bUT the script is not working

code

forward OnPlayerCommandPerformed(playerid, cmdtext[], success);

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new string[70];
format(string, sizeof(string), "Command %s dont exits, Type /cmds for all your commands.", cmdtext);
SendClientMessage(playerid,COLOR_RED, string);
}
return true;
}
Reply
#10

change return true to return 1;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)