[Help]Error
#2

Don't copy-paste code you don't understand. That's where this errors come from.

The errors refer to the fact that none of those variables have been made.

Quote:
Originally Posted by sa-mp_wiki
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[30];
    new 
idx;
    
cmd strtok(cmdtextidx);
 
    if(
strcmp(cmd"/sayhello"true) == 0)
    {
        new 
tmp[30];
        
// assign the id (written by the user) to tmp
        
tmp strtok(cmdtextidx);
 
        
// convert the id to an integer using strval (this is essential)
        // and assign to otherplayer
        
new otherplayer strval(tmp);
 
        if(
IsPlayerConnected(otherplayer))
        {
            
SendClientMessage(otherplayer0xFFFF00AA"Hi, hello!");
        }
        return 
1;
    }
    return 
0;

This is just an example of SOME of what you are missing, the giveplayerid and giveplayer should just be a case of making a "new giveplayerid, giveplayer;" line in the command.
Reply


Messages In This Thread
[Help]Error - by alekschowee - 28.08.2016, 18:07
Re: [Help]Error - by Sew_Sumi - 28.08.2016, 18:14
Re: [Help]Error - by Sh4dow04 - 28.08.2016, 18:15
Re: [Help]Error - by HidroDF - 28.08.2016, 18:17

Forum Jump:


Users browsing this thread: 2 Guest(s)