UPDATE:
strcat - outcome: Deliver supplies from to .
Код:
CMD:work(playerid, params[])
{
new vid = GetPlayerVehicleID(playerid), string[512];
if(pInfo[playerid][InWork] == true) return SendClientMessage(playerid, -1, ""COL_GRAY"You are still in the middle of a work!:");
//if(GetVehicleModel(vid) != 403 || GetVehicleModel(vid) != 515 || GetVehicleModel(vid) != 514) return SendClientMessage(playerid, -1, ""COL_GRAY"You must be in a truck to start working!");
if(!IsTrailerAttachedToVehicle(vid)) return SendClientMessage(playerid, -1, ""COL_GRAY"You need to have a trailer attached to your vehicle to start working!");
new rand = random(sizeof(mLocations[]));
strcat(pInfo[playerid][LocIDName1], mLocations[rand][Name]);
pInfo[playerid][X1] = mLocations[rand][X];
pInfo[playerid][Y1] = mLocations[rand][Y];
pInfo[playerid][Z1] = mLocations[rand][Z];
rand = random(sizeof(mLocations[]));
strcat(pInfo[playerid][LocIDName2], mLocations[rand][Name]);
pInfo[playerid][X2] = mLocations[rand][X];
pInfo[playerid][Y2] = mLocations[rand][Y];
pInfo[playerid][Z2] = mLocations[rand][Z];
format(string, sizeof(string), ""COL_YELLOW"WORK:"COL_WHITE" Deliver supplies from "COL_YELLOW"%s"COL_WHITE" to "COL_YELLOW"%s"COL_WHITE".",pInfo[playerid][LocIDName1],pInfo[playerid][LocIDName2]);
SendClientMessage(playerid, -1, string);
SendClientMessage(playerid, -1, ""COL_YELLOW"WORK:"COL_WHITE" You can always stop work using /stopwork.");
SetPlayerCheckpoint(playerid, pInfo[playerid][X1], pInfo[playerid][Y1], pInfo[playerid][Z1], 7);
pInfo[playerid][VehicleID] = vid;
pInfo[playerid][VehicleTrailerID] = GetVehicleTrailer(vid);
pInfo[playerid][InWork] = true;
return 1;
}
strcpy - outcome: SERVER: Unknown command.
Код:
CMD:work(playerid, params[])
{
new vid = GetPlayerVehicleID(playerid), string[512];
if(pInfo[playerid][InWork] == true) return SendClientMessage(playerid, -1, ""COL_GRAY"You are still in the middle of a work!:");
//if(GetVehicleModel(vid) != 403 || GetVehicleModel(vid) != 515 || GetVehicleModel(vid) != 514) return SendClientMessage(playerid, -1, ""COL_GRAY"You must be in a truck to start working!");
if(!IsTrailerAttachedToVehicle(vid)) return SendClientMessage(playerid, -1, ""COL_GRAY"You need to have a trailer attached to your vehicle to start working!");
new rand = random(sizeof(mLocations[]));
strcpy(pInfo[playerid][LocIDName1], mLocations[rand][Name]);
pInfo[playerid][X1] = mLocations[rand][X];
pInfo[playerid][Y1] = mLocations[rand][Y];
pInfo[playerid][Z1] = mLocations[rand][Z];
rand = random(sizeof(mLocations[]));
strcpy(pInfo[playerid][LocIDName2], mLocations[rand][Name]);
pInfo[playerid][X2] = mLocations[rand][X];
pInfo[playerid][Y2] = mLocations[rand][Y];
pInfo[playerid][Z2] = mLocations[rand][Z];
format(string, sizeof(string), ""COL_YELLOW"WORK:"COL_WHITE" Deliver supplies from "COL_YELLOW"%s"COL_WHITE" to "COL_YELLOW"%s"COL_WHITE".",pInfo[playerid][LocIDName1],pInfo[playerid][LocIDName2]);
SendClientMessage(playerid, -1, string);
SendClientMessage(playerid, -1, ""COL_YELLOW"WORK:"COL_WHITE" You can always stop work using /stopwork.");
SetPlayerCheckpoint(playerid, pInfo[playerid][X1], pInfo[playerid][Y1], pInfo[playerid][Z1], 7);
pInfo[playerid][VehicleID] = vid;
pInfo[playerid][VehicleTrailerID] = GetVehicleTrailer(vid);
pInfo[playerid][InWork] = true;
return 1;
}