09.11.2009, 15:54
guys as all saying if i use dcmd or sscanf the server run faster,command work faster idk and i try to learn a bit from sa-mp wiki /heal command but i get problems with strings ... if i want playername i need something in script like that ''getplayername ... bla bla bla...''
but here is the code:
and here are errors :
can anyone help me cuz i am trying to make perfect server
but here is the code:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { // MEDIC COMMANDS dcmd(heal,4,cmdtext); return 0; } dcmd_heal(playerid,params[]) { new id; if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal [ID]\""); ---------------> LINE 614 else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found"); else { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayername)); -------------------------------> LINE 618 GetPlayerName(playerid, sendername, sizeof(healername)); SetPlayerHealth(id, 100.0); format(string, sizeof(string),"You Have Been Healed By Medic %s[%d]", healername, playerid); SendClientMessage(id, 0x33CCFFAA,string); // Light Blue Color format(string, sizeof(string),"You Healed Player %s[%d],You Get $13", giveplayername, id); SendClientMessage(playerid, 0x00FF00AA, "Player healed"); GivePlayerMoney(playerid,13); } return 1; }
Код:
C:\Documents and Settings\samp\Desktop\Server2\gamemodes\WeedsCNR.pwn(614) : error 017: undefined symbol "sscanf" C:\Documents and Settings\samp\Desktop\Server2\gamemodes\WeedsCNR.pwn(618) : error 017: undefined symbol "giveplayerid" C:\Documents and Settings\samp\Desktop\Server2\gamemodes\WeedsCNR.pwn(618) : error 017: undefined symbol "giveplayername" C:\Documents and Settings\samp\Desktop\Server2\gamemodes\WeedsCNR.pwn(618) : error 029: invalid expression, assumed zero C:\Documents and Settings\samp\Desktop\Server2\gamemodes\WeedsCNR.pwn(618) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.