12.06.2010, 13:23
if i add if(IsPlayerInDynamicCP(playerid, gCheckpoint[18]) TogglePlayerDynamicCP(playerid, 18, true));
it just crashes.
it just crashes.
Код:
if(strcmp(cmdtext, "/buyheal", true) == 0) { if(IsSpawned[playerid] == 0) { SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command"); return 1; } if(IsPlayerInDynamicCP(playerid, gCheckpoint[18]) TogglePlayerDynamicCP(playerid, 18, true)); SendClientMessage(playerid,COLOR_ERROR,"You are not in the hospital checkpoint"); return 1; } if(gTeam[playerid] == TEAM_MEDIC) { SendClientMessage(playerid,COLOR_ERROR,"You are a Medic. Use /healme or /cureme"); return 1; } if(gTeam[playerid] == TEAM_PVTMED) { SendClientMessage(playerid,COLOR_ERROR,"You are a Private Medic. Use /healme or /cureme"); return 1; } if(IsPlayerInDynamicCP(playerid, gCheckpoint[18]) TogglePlayerDynamicCP(playerid, 18, true)); SendClientMessage(playerid,COLOR_ERROR,"You are not at the Los Santos hospital"); return 1; } if(GetPlayerMoney(playerid) <= 999 && IsPlayerInCheckpoint(playerid)) { SendClientMessage(playerid,COLOR_ERROR,"You cannot afford this Medical Service {$1000)"); return 1; } new Float:health; GetPlayerHealth(playerid, health); if(health == 100) { SendClientMessage(playerid,COLOR_ERROR,"You do not have any injuries"); return 1; } TogglePlayerDynamicCP(playerid, 18, true) || TogglePlayerDynamicCP(playerid, 19, true); { SetPlayerHealth(playerid,100); GameTextForPlayer(playerid, "~g~HEALED", 6000, 3); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,COLOR_FORESTGREEN,"You have purchased Medical services. You have been charged $1000."); } return 1; }