public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/jobs", cmdtext, true, 10) == 0) { if(CanJob[playerid] == 1)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You can only do a job each 2 minutes."); if(InJob[playerid] > 0)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You're already in a job."); ShowJobs(playerid); SendClientMessage(playerid, COLOR_LIGHTRED, "JOBS: {FFFFFF}Choose the job by clicking it!"); return 1; } return 0; } { if (strcmp("/pizza", cmdtext, true, 10) == 0) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448) { PizzaJob[playerid] = 1; SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10); SendClientMessage(playerid, COLOR_LIGHTRED,"* Segui i checkpoint per ricevere la paga!"); return 1; } SendClientMessage(playerid, COLOR_LIGHTRED,"Devi essere sul Pizzaboy per lavorare!"); } return 0; }
Hi guys, I have this error: "start of function body without function header".
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/jobs", cmdtext, true, 10) == 0) { if(CanJob[playerid] == 1)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You can only do a job each 2 minutes."); if(InJob[playerid] > 0)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You're already in a job."); ShowJobs(playerid); SendClientMessage(playerid, COLOR_LIGHTRED, "JOBS: {FFFFFF}Choose the job by clicking it!"); return 1; } if (strcmp("/pizza", cmdtext, true, 10) == 0) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448) { PizzaJob[playerid] = 1; SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10); SendClientMessage(playerid, COLOR_LIGHTRED,"* Segui i checkpoint per ricevere la paga!"); return 1; } SendClientMessage(playerid, COLOR_LIGHTRED,"Devi essere sul Pizzaboy per lavorare!"); } return 0; } How to fix it? Thanks all! |
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/jobs", cmdtext, true, 10) == 0)
{
if(CanJob[playerid] == 1)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You can only do a job each 2 minutes.");
if(InJob[playerid] > 0)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You're already in a job.");
ShowJobs(playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, "JOBS: {FFFFFF}Choose the job by clicking it!");
return 1;
}
return 0;
}
{ //Why this bracket ?
if (strcmp("/pizza", cmdtext, true, 10) == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
PizzaJob[playerid] = 1;
SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);
SendClientMessage(playerid, COLOR_LIGHTRED,"* Segui i checkpoint per ricevere la paga!");
return 1;
}
SendClientMessage(playerid, COLOR_LIGHTRED,"Devi essere sul Pizzaboy per lavorare!");
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/jobs", cmdtext, true, 10) == 0)
{
if(CanJob[playerid] == 1)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You can only do a job each 2 minutes.");
if(InJob[playerid] > 0)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You're already in a job.");
ShowJobs(playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, "JOBS: {FFFFFF}Choose the job by clicking it!");
return 1;
}
return 0;
}
if (strcmp("/pizza", cmdtext, true, 10) == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
PizzaJob[playerid] = 1;
SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);
SendClientMessage(playerid, COLOR_LIGHTRED,"* Segui i checkpoint per ricevere la paga!");
return 1;
}
SendClientMessage(playerid, COLOR_LIGHTRED,"Devi essere sul Pizzaboy per lavorare!");
}
return 0;
}