20.08.2009, 22:08
Okay so i made a command that will heal people its for RP for the medics.... will it work ? if not fix it please..
Код:
if(strcmp(cmd, "/tryheal", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new playa;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new succeed = 1 + random(2);
if(succeed == 1)
{
SetPlayerHealth(playa, 75);
format(string, sizeof(string), " %s tries to heal %s and succeeded.");
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if(succeed == 2)
{
format(string, sizeof(string), " %s tries to heal %s and failed.");
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}

