- เครดิต
- 480
- ความรู้
-
- เงิน $
-
- ความดี
-
|
if(strcmp(cmd, "/veh", true) == 0 || strcmp(cmd, "/เสกรถ", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new car, color1, color2;
if (sscanf(params, "dD(-1)D(-1)", car, color1, color2))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /เสกรถ [carid] [color1] [color2]");
return 1;
}
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 or above 611 !"); return 1; }
if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 252 !"); return 1; }
if(color2 < 0 || color2 > 252) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 252 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
for(new i=0;i!=MAX_ADMIN_VEHICLES;i++) if(!AdminSpawnedVehicles[i])
{
AdminSpawnedVehicles[i] = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
format(string, sizeof(string), " คุณได้เสกรถ ID %d, Veh ID %d", car, AdminSpawnedVehicles[i]);
SendClientMessage(playerid, COLOR_GREY, string);
GetPlayerName(playerid,sendername, sizeof(sendername));
format(string, 256, "AdmWarning: %s ได้เสกรถ ID %d, Veh ID %d ออกมาใช้", sendername, car, AdminSpawnedVehicles[i]);
SendAdminMessage(COLOR_YELLOW, string);
LinkVehicleToInterior(AdminSpawnedVehicles[i], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(AdminSpawnedVehicles[i], GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, AdminSpawnedVehicles[i], 0);
break;
}
}
return 1;
} |
|