04.03.2012, 14:15
@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:
make sure that this part:
is the end of OnPlayerCommandText (already written in the correct code).
Modify:
Sorry, the replying speed of users here is really fast. Dwane's code will work.
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 Код:
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;
}
pawn Код:
return 0;
}
Modify:
Sorry, the replying speed of users here is really fast. Dwane's code will work.

