07.04.2018, 19:40
if someone can help me to pass this command to dialog, I thank you
PHP код:
CMD:repair(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 2180.9875,-1979.7583,13.5606)) //Optional - CHANGE
{
new string[128], item[32], pID, mName[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
if(sscanf(params, "s[32] ", item)) {
SendClientMessage(playerid, -1, "USAGE: /repair [option]");
SendClientMessage(playerid, -1, "Options: bodykit, engine");
return 1;
}
if(strcmp(item,"bodykit",true) == 0) {
if (sscanf(params, "s[32]u", item, pID)) return SendClientMessage(playerid, -1, "USAGE: /repair bodykit [ID/Name]");
GetPlayerName(playerid, mName, sizeof(mName));
GetPlayerName(pID, pName, sizeof(pName));
format(string, sizeof(string), "%s has offered you a repair of bodykit on your car!", mName);
SendClientMessage(pID, COLOR_LIGHTBLUE, string);
SendClientMessage(pID, COLOR_LIGHTBLUE, "Use: /acceptmeh to accept that offer!");
format(string, sizeof(string), "You offered %s to repair bodykit on his vehicle.", pName);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
Service[pID][1] = 1;
}
else if(strcmp(item,"engine",true) == 0) {
if(sscanf(params, "s[32]u",item, pID)) return SendClientMessage(playerid, -1, "USAGE: /repair engine [ID/Name]");
GetPlayerName(playerid, mName, sizeof(mName));
GetPlayerName(pID, pName, sizeof(pName));
format(string, sizeof(string), "%s has offered you a repair of engine on your vehicle!", mName);
SendClientMessage(pID, COLOR_LIGHTBLUE, string);
SendClientMessage(pID, COLOR_LIGHTBLUE, "Use: /acceptmeh to accept that offer!");
format(string, sizeof(string), "You offered %s to repair engine on his vehicle.", pName);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
Service[pID][2] = 1;
}
}
else return SendClientMessage(playerid, COLOR_RED, "You must be in the garage to repair vehicles!");
return 1;
}