16.05.2011, 14:52
OK,so now it was much more eaiser to script this command,than trying to script it with strcmp and strtok wich gave me bad head aches(I converted to ZCMD):
And now this is my new heal command,but I have some errors:
My errors are:
WARNING:I'm not sure if it is gonna work in-game so please don't try just to fix errors but also tell me if this could work in game or no(I mean if it's scripted corectly or no)
And now this is my new heal command,but I have some errors:
pawn Код:
COMMAND:heal(playerid,params[])
{
if(gTeam[playerid] == TEAM_MEDICS)
{
new p1;
new p2;
if(sscanf(params,"u",p2) return SendClientMessage(playerid,COLOR_RED,"USAGE: /heal [id]");
GetPlayerHealth(p2); //line 696
if(GetPlayerHealth(p2) < 80) //line 697
{
GetDistanceBetweenPlayers(p1,p2);
if(GetDistanceBetweenPlayers(p1,p2) > 5) return SendClientMessage(p1,COLOR_RED,"Player is too far away");
if(GetDistanceBetweenPlayers(p1,p2) < 5)
{
SetPlayerHealth(p2,100);
GivePlayerMoney(p2,-500);
GivePlayerMoney(p1,500);
SendClientMessageToAll(COLOR_PURPLE,"Player %s has been healed by medic %s");
}
}
}
if(gTeam[playerid] == TEAM_COPS || gTeam[playerid] == TEAM_ROBBERS || gTeam[playerid] == TEAM_FIREFIGHTERS)
{
SendClientMessage(playerid,COLOR_RED,"This command is only for medics.");
return 0;
}
return true;
}
Код:
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_R2-2_win32\gamemodes\sfcrdmrp.pwn(696) : warning 202: number of arguments does not match definition D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_R2-2_win32\gamemodes\sfcrdmrp.pwn(697) : warning 202: number of arguments does not match definition