Detaljan opis problema:
Imam komandu /heal i sve ona uredu radi, ali problem je u tome, da doktori mogu da dodju do igraca i heal ga i uzmu mu pare, bez da je on prihvatio... Mogu tako krasti pare... Ako moze, ja imam komandu /prihvati, i sto bih u nju trebao ubaciti?
Dio skripte:
Evo komande od /heal
COMMAND:heal(playerid, params[])
{
if(PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You are unconscious.");
new targetid, money, str;
if(PlayerStat != 2) return SendClientMessage(playerid, GREY, "You are not a Prison Doctor.");
if(PlayerStat == 0) return SendClientMessage(playerid, GREY, "You are not on duty.");
if(sscanf(params,"ud", targetid, money))return SendClientMessage(playerid, GREY, "USAGE: /heal ");
if(targetid == playerid) return SendClientMessage(playerid, GREY, "You can't heal yourself.");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, "Target ID not found.");
if(money > 200) return SendClientMessage(playerid, GREY, "The money mustn't be over $200.");
if(money < 20) return SendClientMessage(playerid, GREY, "The money mustn't be under $20.");
if(IsPlayerInRangeOfPlayer(2.0, playerid, targetid))
{
if(money > PlayerStat) return SendClientMessage(playerid, GREY, "Target ID can't afford this.");
if(PlayerStat == 1) return SendClientMessage(playerid, GREY, "Target ID is already being threated in the prison clinic.");
if(PlayerStat == 1)
{
TogglePlayerControllable(targetid, 1);
ClearAnimations(targetid);
PlayerStat = 0;
PlayerStat = 0;
SetHealth(targetid, 100);
GivePlayerMoney(targetid, -money);
GivePlayerMoney(playerid, money);
format(str, sizeof(str), "%s has healed %s using their medical tools", GetICName(playerid), GetICName(targetid));
SendNearByMessage(playerid, ACTION_COLOR, str, 3);
format(str, sizeof(str), "You have successfully healed %s for $%d.", GetICName(targetid), money);
SendClientMessage(playerid, DOCTORS_RADIO , str);
format(str, sizeof(str), "%s has healed you for $%d.", GetICName(targetid), money);
SendClientMessage(targetid, DOCTORS_RADIO , str);
SetCameraBehindPlayer(targetid);
}
else
{
SetHealth(targetid, 100);
GivePlayerMoney(targetid, -money);
GivePlayerMoney(playerid, money);
format(str, sizeof(str), "* %s has healed %s using their medical tools", GetICName(playerid), GetICName(targetid));
SendNearByMessage(playerid, ACTION_COLOR, str, 3);
format(str, sizeof(str), "You have successfully healed %s for $%d.", GetICName(targetid), money);
SendClientMessage(playerid, DOCTORS_RADIO , str);
format(str, sizeof(str), "%s has healed you for $%d.", GetICName(targetid), money);
SendClientMessage(targetid, DOCTORS_RADIO , str);
}
}
else return SendClientMessage(playerid, GREY, "Target ID is too far away.");
return 1;
}
A evo i od /prihvati
Da ubacim nesto u else? Stvaro neznam
COMMAND:prihvati(playerid, params[])
{
if(PlayerStat == 1 || PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You can't use this command right now.");
if(isnull(params)) return SendClientMessage(playerid, GREY, "USAGE: /prihvati [fight/death]");
else if(!strcmp(params, "fight", true))
{
if(PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You are unconscious.");
if(PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You are cuffed or being dragged.");
new str;
if(PlayerStat > 999) return SendClientMessage(playerid, GREY, "Nobody requested to start a fight with you.");
format(str, sizeof(str), "Prihvatio si borbu s %s u zatvorskom ringu.",GetICName(PlayerStat));
SendClientMessage(playerid, GOLD, str);
format(str, sizeof(str), "%s je prihvatio tvoj zahtijev za borbu.", GetICName(playerid));
SendClientMessage(PlayerStat, GOLD, str);
SetHealth(playerid, 100);
SetHealth(PlayerStat, 100);
SetPlayerInterior(playerid, 0);
SetPlayerInterior(PlayerStat, 0);
SetPlayerPos(playerid, 1765.5271,-1536.2958,10.3738);
SetPlayerFacingAngle(playerid, 235.1355);
SetPlayerPos(PlayerStat, 1761.5647,-1532.6384,10.3738);
SetPlayerFacingAngle(PlayerStat, 48.7004);
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(PlayerStat, false);
SetCameraBehindPlayer(playerid);
SetCameraBehindPlayer(PlayerStat);
GameTextForPlayer(playerid, "~g~The Boxing Match Will start in 10 seconds.", 3000, 1);
GameTextForPlayer(PlayerStat, "~r~ Borba ce poceti za 10 sekundi.", 3000, 4);
PlayerStat = 10;
PlayerStat[PlayerStat] = 10;
PlayerStat = 9999;
Server = 1;
}
else if(!strcmp(params, "gang", true))
{
if(PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You are unconscious.");
new str;
if(PlayerStat == 0) return SendClientMessage(playerid, GREY, "Nobody invited you to join a gang.");
PlayerStat = PlayerStat;
PlayerStat = 1;
format(str, sizeof(str), "%s has accepted to join %s, Welcome!", GetOOCName(playerid), GangStat[PlayerStat]);
SendGangMessage(playerid, GangStat[PlayerStat], str);
GangStat[PlayerStat] += 1;
format(GangStat[PlayerStat], 60, "Gangs/Gang %d.ini", PlayerStat);
if(INI_Open(GangStat[PlayerStat]))
{
INI_WriteInt("Members", GangStat[PlayerStat]);
INI_Save();
INI_Close();
}
}
else if(!strcmp(params, "faction", true))
{
if(PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You are unconscious.");
new str;
if(PlayerStat == 0) return SendClientMessage(playerid, GREY, "Nobody invited you to join a faction.");
PlayerStat = PlayerStat;
PlayerStat = 1;
if(PlayerStat == 1)
{
format(str, sizeof(str), "%s has accepted to join High End Prison Guards, Welcome!", GetOOCName(playerid));
SendFactionMessage(playerid, GUARDS_RADIO, str);
}
else if(PlayerStat == 2)
{
format(str, sizeof(str), "%s has accepted to join High End Prison Infirmary, Welcome!", GetOOCName(playerid));
SendFactionMessage(playerid, DOCTORS_RADIO, str);
}
}
else if(!strcmp(params, "death", true))
{
if(PlayerStat == 0) return SendClientMessage(playerid, GREY, "You can't use this command right now.");
PlayerStat = 1;
PlayerStat = 49;
PlayerStat = 0;
new Random = random(sizeof(HospitalSpawns));
SetPlayerPos(playerid, HospitalSpawns, HospitalSpawns, HospitalSpawns);
SetPlayerCameraPos(playerid,1144.3436,-1308.6213,1024.00);
SetPlayerCameraLookAt(playerid, 1138.2471,-1302.6396,1024.6106);
SetHealth(playerid, 1.0);
SetArmour(playerid, 0.0);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, RED, "Prihvatio si smrt, i premjesten u zatvorsku kliniku.");
SendClientMessage(playerid, RED, "Biti ces pusten, kada se oporavis.");
ApplyAnimation(playerid, "PED", "FLOOR_hit_f", 4.1, 0, 1, 1, 1, 0, 1);
}
else if(!strcmp(params, "handshake", true))
{
if(PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You are unconscious.");
if(PlayerStat == 1 || PlayerStat == 1) return SendClientMessage(playerid, GREY, "You are cuffed or being dragged.");
if(PlayerStat == -1) return SendClientMessage(playerid, GREY, "Nitko ti nije ponudio ''rukovanje''");
if(IsPlayerInRangeOfPlayer(2.0, PlayerStat, playerid))
{
switch(PlayerStat)
{
case 1:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Rukovanje prihvaceno.");
SendClientMessage(PlayerStat, WHITE, "Rukovanje prihvaceno.");
PlayerStat = -1;
}
case 2:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Rukovanje prihvaceno.");
SendClientMessage(PlayerStat, WHITE, "Rukovanje prihvaceno.");
PlayerStat = -1;
}
case 3:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Rukovanje prihvaceno.");
SendClientMessage(PlayerStat, WHITE, "Rukovanje prihvaceno.");
PlayerStat = -1;
}
case 4:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkcb", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkcb", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Rukovanje prihvaceno.");
SendClientMessage(PlayerStat, WHITE, "Rukovanje prihvaceno.");
PlayerStat = -1;
}
case 5:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkda", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkda", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Rukovanje prihvaceno.");
SendClientMessage(PlayerStat, WHITE, "Rukovanje prihvaceno.");
PlayerStat = -1;
}
case 6:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkea", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkea", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Handshake accepted.");
SendClientMessage(PlayerStat, WHITE, "Handshake accepted.");
PlayerStat = -1;
}
case 7:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkfa", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkfa", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Handshake accepted.");
SendClientMessage(PlayerStat, WHITE, "Handshake accepted.");
PlayerStat = -1;
}
case 8:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "hndshkfa_swt", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "hndshkfa_swt", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Handshake accepted.");
SendClientMessage(PlayerStat, WHITE, "Handshake accepted.");
PlayerStat = -1;
}
case 9:
{
PutPlayerInFrontOfPlayer(playerid, PlayerStat);
ApplyAnimation(playerid, "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1000);
ApplyAnimation(PlayerStat, "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1000);
SendClientMessage(playerid, WHITE, "Handshake accepted.");
SendClientMessage(PlayerStat, WHITE, "Handshake accepted.");
PlayerStat = -1;
}
}
}
}
else return SendClientMessage(playerid, GREY, "Invalid option.");
return 1;
}Neke slike/video za lakse dobivanje pomoci(neobavezno)://
