Adat ellenõrzés ellõtt kellene lekérni az adatot.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(\"/kocsi\", cmdtext) == 0)
{
new
Float: X,
Float: Y,
Float: Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(540, X, Y, Z, 0, 1, 160, 1000);
return 1;
}
if (strcmp(\"/motor\", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new kocsiid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(kocsiid, engine, lights, alarm, doors, bonnet, boot, objective); // Lekérés
if(engine == 1) // Ellenõrzés
{
SetVehicleParamsEx(kocsiid, 0,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, 0xff0000AA, \"Real Life RPG: Leállítottad a jármûved motorját !\");
}
if(engine == 0)
{
SetVehicleParamsEx(kocsiid, 1,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, 0xff0000AA, \"Real Life RPG: Beindítottad a jármûved motorját !\");
}
} else {
SendClientMessage(playerid, 0xff0000AA, \"Real Life RPG: HIBA: Nem te vezeted a jármûvet !\");
}
} else {
SendClientMessage(playerid, 0xff0000AA, \"Real Life RPG: HIBA: Nem ülsz jármûben !\");
}
return 1;
}
return SendClientMessage(playerid, 0xff0000AA, \"Real Life RPG: HIBA: Ismeretlen parancs. Parancsokért: /help\");
}