C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3789) : error 010: invalid function or declaration C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3791) : error 021: symbol already defined: "SendClientMessage" C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3796) : error 010: invalid function or declaration C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3798) : error 021: symbol already defined: "SendClientMessage" C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3804) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/rules", cmdtext, true, 10) == 0)
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
SendClientMessage(playerid, COLOR_WHITE, "1.No Death Matching");
SendClientMessage(playerid, COLOR_WHITE, "2.Car Jacking is not allowed");
SendClientMessage(playerid, COLOR_WHITE, "3.Do not disrespect other players.");
SendClientMessage(playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!");
SendClientMessage(playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!");
SendClientMessage(playerid, COLOR_WHITE, "6.Respect the other players, and admins too.");
SendClientMessage(playerid, COLOR_WHITE, "7.Please follow all the rules and have fun! :)");
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
}
if(strcmp("/help", cmdtext, true, 10) == 0)
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
SendClientMessage(playerid, COLOR_WHITE, "/teles /report /rules");
SendClientMessage(playerid, COLOR_WHITE, "Yeah thats basically it.");
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
}
if(strcmp("/teles", cmdtext, true, 10) == 0)
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=============");
SendClientMessage(playerid, COLOR_WHITE, "/spawn /drift /drift2 /drift3 /drift4 /drift5 /drift6");
SendClientMessage(playerid, COLOR_WHITE, "/drift7 /drift8 /drift9 /tune /tune2 /SFAdrift ");
SendClientMessage(playerid, COLOR_WHITE, "/drifttrack1 /driftcanyon ");
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=================");
return 1;
}
|
hey guys i was making some commands for my server i tried to compile it and i get this.
Код:
C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3789) : error 010: invalid function or declaration C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3791) : error 021: symbol already defined: "SendClientMessage" C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3796) : error 010: invalid function or declaration C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3798) : error 021: symbol already defined: "SendClientMessage" C:\Documents and Settings\Administrator\Desktop\gta sa server\gamemodes\DDPDRIFT.pwn(3804) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/rules", cmdtext, true, 10) == 0)
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
SendClientMessage(playerid, COLOR_WHITE, "1.No Death Matching");
SendClientMessage(playerid, COLOR_WHITE, "2.Car Jacking is not allowed");
SendClientMessage(playerid, COLOR_WHITE, "3.Do not disrespect other players.");
SendClientMessage(playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!");
SendClientMessage(playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!");
SendClientMessage(playerid, COLOR_WHITE, "6.Respect the other players, and admins too.");
SendClientMessage(playerid, COLOR_WHITE, "7.Please follow all the rules and have fun! :)");
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
}
if(strcmp("/help", cmdtext, true, 10) == 0)
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
SendClientMessage(playerid, COLOR_WHITE, "/teles /report /rules");
SendClientMessage(playerid, COLOR_WHITE, "Yeah thats basically it.");
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
}
if(strcmp("/teles", cmdtext, true, 10) == 0)
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=============");
SendClientMessage(playerid, COLOR_WHITE, "/spawn /drift /drift2 /drift3 /drift4 /drift5 /drift6");
SendClientMessage(playerid, COLOR_WHITE, "/drift7 /drift8 /drift9 /tune /tune2 /SFAdrift ");
SendClientMessage(playerid, COLOR_WHITE, "/drifttrack1 /driftcanyon ");
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=================");
return 1;
}
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/rules", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
SendClientMessage(playerid, COLOR_WHITE, "1.No Death Matching");
SendClientMessage(playerid, COLOR_WHITE, "2.Car Jacking is not allowed");
SendClientMessage(playerid, COLOR_WHITE, "3.Do not disrespect other players.");
SendClientMessage(playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!");
SendClientMessage(playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!");
SendClientMessage(playerid, COLOR_WHITE, "6.Respect the other players, and admins too.");
SendClientMessage(playerid, COLOR_WHITE, "7.Please follow all the rules and have fun! :)");
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
return 1;
}
}
if(strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
SendClientMessage(playerid, COLOR_WHITE, "/teles /report /rules");
SendClientMessage(playerid, COLOR_WHITE, "Yeah thats basically it.");
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
return 1;
}
}
if(strcmp("/teles", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=============");
SendClientMessage(playerid, COLOR_WHITE, "/spawn /drift /drift2 /drift3 /drift4 /drift5 /drift6");
SendClientMessage(playerid, COLOR_WHITE, "/drift7 /drift8 /drift9 /tune /tune2 /SFAdrift ");
SendClientMessage(playerid, COLOR_WHITE, "/drifttrack1 /driftcanyon ");
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=================");
return 1;
}
return 0;
}
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if( strcmp( "/rules", cmdtext, true, 6 ) == 0 )
{
SendClientMessage( playerid, COLOR_GREEN, "=================The Laws of The Land==================" );
SendClientMessage( playerid, COLOR_WHITE, "1.No Death Matching" );
SendClientMessage( playerid, COLOR_WHITE, "2.Car Jacking is not allowed" );
SendClientMessage( playerid, COLOR_WHITE, "3.Do not disrespect other players." );
SendClientMessage( playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!" );
SendClientMessage( playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!" );
SendClientMessage( playerid, COLOR_WHITE, "6.Respect the other players, and admins too." );
SendClientMessage( playerid, COLOR_WHITE, "7.Please follow all the rules and have fun! :)" );
SendClientMessage( playerid, COLOR_GREEN, "=================The Laws of The Land==================" );
return 1;
}
if( strcmp( "/help", cmdtext, true, 5 ) == 0 )
{
SendClientMessage( playerid, COLOR_GREEN, "====================Drift World==================" );
SendClientMessage( playerid, COLOR_WHITE, "/teles /report /rules" );
SendClientMessage( playerid, COLOR_WHITE, "Yeah thats basically it." );
SendClientMessage( playerid, COLOR_GREEN, "====================Drift World==================" );
return 1;
}
if(strcmp( "/teles", cmdtext, true, 6 ) == 0 )
{
SendClientMessage( playerid, COLOR_GREEN, "==============Drift World Telelports=============" );
SendClientMessage( playerid, COLOR_WHITE, "/spawn /drift /drift2 /drift3 /drift4 /drift5 /drift6" );
SendClientMessage( playerid, COLOR_WHITE, "/drift7 /drift8 /drift9 /tune /tune2 /SFAdrift " );
SendClientMessage( playerid, COLOR_WHITE, "/drifttrack1 /driftcanyon " );
SendClientMessage( playerid, COLOR_GREEN, "==============Drift World Telelports=================" );
return 1;
}
return 0;
}
|
pawn Код:
BEST OF LUCK! |
|
@Faisal_khan: I can't see any point of asking for lines of code which its errors are prominent more than the code itself.
And for the solution: You've forgot(?) to use some { or } in the code, which cause it to be out of OnPlayerCommandText, while you can't insert such code out of function. Try to find your mistakes in the correct code: pawn Код:
pawn Код:
|
|
okay i narrowed it down to just error "010: invalid function or declaration" i forgot to add the "{". and lines 3789 to 3804 are at "if(strcmp("/help", cmdtext, true, 10) == 0)" and end at "return 1;"
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/rules", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
SendClientMessage(playerid, COLOR_WHITE, "1.No Death Matching");
SendClientMessage(playerid, COLOR_WHITE, "2.Car Jacking is not allowed");
SendClientMessage(playerid, COLOR_WHITE, "3.Do not disrespect other players.");
SendClientMessage(playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!");
SendClientMessage(playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!");
SendClientMessage(playerid, COLOR_WHITE, "6.Respect the other players, and admins too.");
SendClientMessage(playerid, COLOR_WHITE, "7.Please follow all the rules and have fun! :)");
SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
return 1;
}
if(strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
SendClientMessage(playerid, COLOR_WHITE, "/teles /report /rules");
SendClientMessage(playerid, COLOR_WHITE, "Yeah thats basically it.");
SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
return 1;
}
if(strcmp("/teles", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=============");
SendClientMessage(playerid, COLOR_WHITE, "/spawn /drift /drift2 /drift3 /drift4 /drift5 /drift6");
SendClientMessage(playerid, COLOR_WHITE, "/drift7 /drift8 /drift9 /tune /tune2 /SFAdrift ");
SendClientMessage(playerid, COLOR_WHITE, "/drifttrack1 /driftcanyon ");
SendClientMessage(playerid, COLOR_GREEN, "==============Drift World Telelports=================");
return 1;
}
return 0;
}
return 0;
}
|
@Faisal_khan: I can't see any point of asking for lines of code which its errors are prominent more than the code itself.
|
|
pawn Код:
Let's start! First of all, you closed more bracket than those you opened. Also, the lenght is totally wrong. Oh, Great! Onother one person who doesn't know how to count how many characters a command has. The lenght is optionalm, so it's better not use it. |
but anyway thnx for editing.