string enum printing problem
#10

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;
}
Reply


Messages In This Thread
string enum printing problem - by TheSimpleGuy - 27.04.2016, 07:19
Re: string enum printing problem - by SyS - 27.04.2016, 07:20
Re: string enum printing problem - by TheSimpleGuy - 27.04.2016, 07:22
Re: string enum printing problem - by biker122 - 27.04.2016, 07:22
Re: string enum printing problem - by TheSimpleGuy - 27.04.2016, 07:24
Re: string enum printing problem - by biker122 - 27.04.2016, 07:26
Re: string enum printing problem - by PrO.GameR - 27.04.2016, 07:28
Re: string enum printing problem - by TheSimpleGuy - 27.04.2016, 07:28
Re: string enum printing problem - by biker122 - 27.04.2016, 07:31
Re: string enum printing problem - by TheSimpleGuy - 27.04.2016, 07:40

Forum Jump:


Users browsing this thread: 1 Guest(s)