OnPlayerCommandReceived alján return 0 helyett return 1 kell.
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(strcmp(\"/speedo\", cmdtext, true, 10) == 0)
{
new strOptionInfo[2][37]=
{
\"Bekapcsoltad a sebességmérõt\",
\"Kikapcsoltad a sebességmérõt\"
};
DeActiveSpeedometer[playerid] = !DeActiveSpeedometer[playerid];
SendClientMessage(playerid, COLOR_GREEN, strOptionInfo[DeActiveSpeedometer[playerid]]);
if(!DeActiveSpeedometer[playerid])
{
for(new i; i < 10; i++)
TextDrawShowForPlayer(playerid, TextDraws[TDSpeedClock]);
for(new i; i < 4; i++)
TextDrawsd[playerid] = TextDrawCreate(555.0, 402.0, \"~b~.\");
}
else
{
for(new i; i < 4; i++)
TextDrawHideForPlayer(playerid, TextDrawsd[playerid]);
for(new i; i < 10; i++)
TextDrawHideForPlayer(playerid, TextDraws[TDSpeedClock]);
}
return 1;
}
if(strcmp(\"/szolgálat\", cmdtext, true, 10) == 0)
{
if(gTeam[playerid] == TEAM_RENDOR)
{
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), \"*** %s Szolgálatba lépett mint rendõr\", name, playerid);
SendClientMessageToAll(COLOR_BLUE, str);
szolgalatban[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, \"*Te nem vagy rendõr*\");
}
return 1;
}
if(strcmp(\"/xd\", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
if(strcmp(\"/menu\", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 1947.3525,-2110.8755,13.1265))
{
SendClientMessage(playerid, COLOR_GREEN, \"Sikeresen ettél!\");
SetPlayerHealth(playerid, 100.0);
}
else
{
SendClientMessage(playerid, COLOR_RED, \"Sikertelenül nem ettél!\");
}
return 1;
}
if(strcmp(\"/nrg500\", cmdtext, true, 10) == 0)
{
SpawnVehicleForPlayer(522, playerid);
SendClientMessage(playerid, COLOR_GREEN, \"*Nrg-500 sikeresen spawnolva*\");
return 1;
}
if(strcmp(\"/police\", cmdtext, true, 10) == 0)
{
SpawnVehicleForPlayer(596, playerid);
SendClientMessage(playerid, COLOR_GREEN, \"*Rendõr autó sikeresen spawnolva*\");
return 1;
}
if (strcmp(\"/sziréna\", cmdtext, true, 6) == 0)
{
if(gTeam[playerid] == TEAM_RENDOR)
{
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, -1, \"* Nem te vagy a sofõr!\");
}
new pveh = GetPlayerVehicleID(playerid);
if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, \"* Nem vagy jármûben!\");
if (VObject(obj[pveh])) return SendClientMessage(playerid, -1, \"* Sziréna kikapcsolva.\"), DObject(obj[pveh]);
switch (GetVehicleModel(pveh))
{
case 596:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.379999, 0.889999, 0.000000, 0.000000, 0.000000);
}
case 597:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.374999, 0.884999, 0.000000, 0.000000, 0.000000);
}
case 598:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.334498, 0.933500, 0.000000, 0.000000, 0.000000);
}
case 599:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, 0.039999, 1.153999, 0.000000, 0.000000, 0.000000);
}
default:
{
return SendClientMessage(playerid, -1, \"* Nem vagy rendõr autóban!\");
}
}
return SendClientMessage(playerid, -1, \"* Sziréna bekapcsolva!\");
}
else
{
SendClientMessage(playerid, COLOR_RED, \"*Te nem vagy rendõr*\");
}
return 1;
}
if(strcmp(\"/destroy\", cmdtext, true, 10) == 0)
{
if(SpawnedVehicle[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, \"*Elõször hívj le egy kocsit!*\");
DestroyVehicle(SpawnedVehicle[playerid]);
SpawnedVehicle[playerid] = 0;
SendClientMessage(playerid, COLOR_GREEN, \"*Jármû törölve*\");
return 1;
}
if(strcmp(\"/weather\", cmdtext, true, 10) == 0)
{
SetWeather(2);
return 1;
}
return 1;
}