SA-MP Forums Archive
server error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: server error (/showthread.php?tid=335519)



server error - AhmadKing - 18.04.2012

Quote:

C:\Users\hp\Desktop\Server12\gamemodes\ak.pwn(2228 ) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

from:
PHP код:
COMMAND:setscore(playerid,params[])
{
    if(
PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,color_red,"You don't have the permission to use this command!");
    new 
id,value;
    if(
sscanf(params,"ii",id,value)) return SendClientMessage(playerid,color_red,"USAGE: /setscore [playerID] [value]")
    
SetPlayerScore(id,value);
    
SendClientMessageEx(id,color_green,"sssis","Administrator ",PlayerInfo[playerid][Username]," has set your score to ",value," !");
    
SendClientMessageEx(playerid,color_green,"sssis","You have set ",PlayerInfo[id][Username],"'s score to ",value," .");
    return 
1;

any 1 knows how to fix it ?ty


another thing;

PHP код:
COMMAND:stats(playerid,params[])
{
    
SendClientMessage(playerid,color_green,"Your current stats:");
    
SendClientMessageEx(playerid,color_yellow,"sis","Score: ",GetPlayerScore(playerid),".");
    
SendClientMessageEx(playerid,color_yellow,"sis","Money: ",GetPlayerMoney(playerid),".");
    return 
1;

can u tell me the code for kills deaths kill ratio , hrs mins etc.


Re: server error - FalconX - 18.04.2012

pawn Код:
COMMAND:setscore(playerid,params[])
{
    if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,color_red,"You don't have the permission to use this command!");
    new id,value;
    if(sscanf(params,"ii",id,value)) return SendClientMessage(playerid,color_red,"USAGE: /setscore [playerID] [value]"); // put the ";" here..
    SetPlayerScore(id,value);
    SendClientMessageEx(id,color_green,"sssis","Administrator ",PlayerInfo[playerid][Username]," has set your score to ",value," !");
    SendClientMessageEx(playerid,color_green,"sssis","You have set ",PlayerInfo[id][Username],"'s score to ",value," .");
    return 1;
}
You forgot to add ";" in the end of 3 line. Just replace it with my command and it should work well..

-FalconX


Re: server error - AhmadKing - 18.04.2012

hey when i changed it all cmds/admin cmds bugged
eg. "/ban 0 hack" tells me USAGE: /ban [ID] [REASON]
someon help pls
says: sscanf error: system not initialised


Re: server error - Shetch - 18.04.2012

Quote:
Originally Posted by AhmadKing
Посмотреть сообщение
hey when i changed it all cmds/admin cmds bugged
eg. "/ban 0 hack" tells me USAGE: /ban [ID] [REASON]
someon help pls
says: sscanf error: system not initialised
There are plenty of posts about this problem. Use search.


Re: server error - sniperwars - 18.04.2012

pawn Код:
COMMAND:setscore(playerid,params[])
{
    if(PlayerInfo[playerid][Level]  >= 2) return SendClientMessage(playerid,color_red,"You don't have the permission to use this command!");
    new id,value;
    if(sscanf(params,"ii",id,value)) return SendClientMessage(playerid,color_red,"USAGE: /setscore [playerID] [value]"); // put the ";" here..
    SetPlayerScore(id,value);
    SendClientMessageEx(id,color_green,"sssis","Administrator ",PlayerInfo[playerid][Username]," has set your score to ",value," !");
    SendClientMessageEx(playerid,color_green,"sssis","You have set ",PlayerInfo[id][Username],"'s score to ",value," .");
    return 1;
}
Changed the < 2) to >=2) and it should work.

Also about the sscanf problem, try and update your plugins.


Re: server error - AhmadKing - 19.04.2012

Quote:
Originally Posted by Shetch
Посмотреть сообщение
There are plenty of posts about this problem. Use search.
if you dont wanna help then dont open my topic.
thx