CMD:votekick(playerid, params[]) { if(pInfo[playerid][Helper] >= 1) { if(VoteOn) return SendClientMessage(playerid, 0xCC0000AA, "There's already a vote going on!"); new Target, reason[64]; if(sscanf(params, "rS(None)[64]", Target, reason)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /votekick <playerid> <raason(optional)>"); VoteOn = true; VoteAgainst = Target; format(VoteReason, sizeof(VoteReason), "%s", reason); VoteTimer = SetTimer("VoteEnd", 60000, false); new string[128]; format(string, sizeof(string), "*"COL_WHITE"* %s votekick has started against%s for %s",Name(Target), VoteReason); SendClientMessageToAll(COLOR_LIGHTBLUE, string); } else return SendClientMessage(playerid, COLOR_RED,"You have to be level 1 to use that command!"); return 1; }
format(string, sizeof(string), "*"COL_WHITE"* %s has banned %s for %s",Name(Target), VoteReason);
error 001: expected token: "-string end-", but found "-identifier-"
If you want to use quotation marks in your strings you'll need to escape them - https://sampwiki.blast.hk/wiki/Escape_codes
If you're trying to use colors in your string, you'll need to embed them, if you want the whole message to be one color, you'd do that with SendClientMessage/SendClientMessageToAll - https://sampwiki.blast.hk/wiki/Colour_Em...olor_embedding |
format(string, sizeof(string), "*{FFFFFF}* %s has banned for %s",Name(Target), VoteReason);
|
C:\Users\PC\Desktop\ALL FILES\dayzsa\DayZ\gamemodes\dayz_4.1.pwn(15606) : error 001: expected token: "-string end-", but found "-identifier-" C:\Users\PC\Desktop\ALL FILES\dayzsa\DayZ\gamemodes\dayz_4.1.pwn(15606) : warning 215: expression has no effect C:\Users\PC\Desktop\ALL FILES\dayzsa\DayZ\gamemodes\dayz_4.1.pwn(15606) : warning 215: expression has no effect C:\Users\PC\Desktop\ALL FILES\dayzsa\DayZ\gamemodes\dayz_4.1.pwn(15606) : error 001: expected token: ";", but found ")" C:\Users\PC\Desktop\ALL FILES\dayzsa\DayZ\gamemodes\dayz_4.1.pwn(15606) : error 029: invalid expression, assumed zero C:\Users\PC\Desktop\ALL FILES\dayzsa\DayZ\gamemodes\dayz_4.1.pwn(15606) : fatal error 107: too many error messages on one line
CMD:votekick(playerid, params[])
{
if(pInfo[playerid][Helper] >= 1)
{
if(VoteOn) return SendClientMessage(playerid, 0xCC0000AA, "There's already a vote going on!");
new Target, reason[64];
if(sscanf(params, "rS(None)[64]", Target, reason)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /votekick <playerid> <raason(optional)>");
VoteOn = true;
VoteAgainst = Target;
format(VoteReason, sizeof(VoteReason), "%s", reason);
VoteTimer = SetTimer("VoteEnd", 60000, false);
new string[128];
format(string, sizeof(string), "*"COL_WHITE"* %s votekick has started against%s for %s",Name(playerid),Name(Target), VoteReason);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
}
else return SendClientMessage(playerid, COLOR_RED,"You have to be level 1 to use that command!");
return 1;
}
format(string, sizeof(string), "*"COL_WHITE"* %s has banned %s for %s",Nam(playerid),Name(Target), VoteReason);
PHP код:
PHP код:
|
Yes it does lol now it shows this twice
error 001: expected token: "-string end-", but found "-identifier-" |
format(string, sizeof(string), "*"COL_WHITE"* %s has banned %s for %s",Nam(playerid),Name(Target), VoteReason);
format(string, sizeof(string), ""COL_WHITE" %s has banned %s for %s",Nam(playerid),Name(Target), VoteReason);