
D:\Bart\Samp Server\gamemodes\Test Gaemode.pwn(50) : error 001: expected token: "-string end-", but found "-identifier-" D:\Bart\Samp Server\gamemodes\Test Gaemode.pwn(50) : error 029: invalid expression, assumed zero D:\Bart\Samp Server\gamemodes\Test Gaemode.pwn(50) : error 029: invalid expression, assumed zero D:\Bart\Samp Server\gamemodes\Test Gaemode.pwn(50) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
SendClientMessage(playerid, COLOR_BLACK, "Welcome to test server");
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_BLACK, "[BR]Yahya__");
SendClientMessage(playerid, COLOR_BLACK, "[BR]Yahya__");
return 1;
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fix", cmdtext, true, 10) == 0)
{
RepairVehicle(vehicleid);
return 1;
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_BLACK, "[BR]Yahya__");
SendClientMessage(playerid, COLOR_BLACK, "[BR]Yahya__");
return 1;
}
return 0;
{
RepairVehicle(vehicleid);
return 1;
}
return 0;
}
D:\Bart\Samp Server\gamemodes\Test Gaemode.pwn(94) : warning 225: unreachable code D:\Bart\Samp Server\gamemodes\Test Gaemode.pwn(95) : error 017: undefined symbol "vehicleid" D:\Bart\Samp Server\gamemodes\Test Gaemode.pwn(98) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
if(!strcmp(cmdtext, "/command", true))
{
// do something here...
}
return true;
// do something else here - but this code will generate a warning about unreachable code as you returned above! And this code won't be reached as the warning suggests.
return false;
RepairVehicle(GetPlayerVehicleID(playerid));
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_BLACK, "[BR]Yahya__");
SendClientMessage(playerid, COLOR_BLACK, "[BR]Yahya__");
return 1;
}
if (strcmp("/fix", cmdtext, true, 10) == 0)
{
RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
return 0;
}
|
Welcome to SA-MP forums, YahyaBR.
It is good that you've done enough research on your own and actually have gotten somewhere. And your script is a lot like with what I started up with 6 years ago. The error line is indeed line 50 in your posted script. The syntax of SendClientMessage is SendClientMessage(playerid, color, message[]). This means that the first 2 parameters are integers (playerid and color - the second parameter is often used with a HEX representation, though) and the 3rd parameter (message) is supposed to be an array. A string message such as "Hey!" is actually an array and after you write a message, the [] characters are not required any more. Please make sure you go through the useful documentation provided at the wiki. Start off with the basics. // Edit: the problem in the second code is that you have 2 returns in the same code block. Returning means that the callback will stop processing the code. This is probably not what you want. pawn Код:
|


|
pawn Код:
Or just use my code: pawn Код:
|