IosifR Posted January 20, 2021 Report Share Posted January 20, 2021 Salut, va rog ajutațima cu comanda Spawncar! Am tot căutat tutoriale sa creez comanda dar nu găsesc. As fi foarte recunoscător dacă m-ați ajuta ! Quote Link to comment Share on other sites More sharing options...
Hackeru Suprem Posted November 1, 2023 Report Share Posted November 1, 2023 Fara admin: CMD:spawncar(playerid, params[]) { new carid; if (sscanf(params, "i", carid)) { if (IsPlayerInRangeOfPoint(playerid, 5.0, spawnX, spawnY, spawnZ)) { if (GetPlayerMoney(playerid) >= carSpawnCost[carid] || PlayerInfo[playerid][pAdmin] >= 1) { if (IsValidCarID(carid)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateVehicle(carid, x, y, z, 0.0, -1, -1, 100); if (PlayerInfo[playerid][pAdmin] < 1) { GivePlayerMoney(playerid, -carSpawnCost[carid]); SendClientMessage(playerid, COLOR_GREEN, "You have spawned the car."); } else { SendClientMessage(playerid, COLOR_GREEN, "You have spawned the car as an admin."); } } else { SendClientMessage(playerid, COLOR_RED, "Invalid car ID. Use /carlist to see available cars."); } } else { SendClientMessage(playerid, COLOR_RED, "You don't have enough money or permission to spawn this car."); } } else { SendClientMessage(playerid, COLOR_RED, "You are not near the spawn point."); } } else { SendClientMessage(playerid, COLOR_GREY, "Usage: /spawncar [carid]"); } return 1; } Cu admin: CMD:spawncar(playerid, params[]) { new carid; if (PlayerInfo[playerid][pAdmin] >= 1) // poti modifica suma de admin { if (IsPlayerInRangeOfPoint(playerid, 5.0, spawnX, spawnY, spawnZ)) { carid = GetRandomCarID(); if (IsValidCarID(carid)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateVehicle(carid, x, y, z, 0.0, -1, -1, 100); SendClientMessage(playerid, COLOR_GREEN, "You have spawned a car."); } else { SendClientMessage(playerid, COLOR_RED, "Failed to spawn a car. Please contact an admin."); } } else { SendClientMessage(playerid, COLOR_RED, "You are not near the spawn point."); } } else { SendClientMessage(playerid, COLOR_RED, "You don't have permission to use this command."); } return 1; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.