25.11.2013, 14:00
[SendAdminMessage works properly in other commands, that's not the reason why is not sending..]
Hi, I have made command /veh, to create vehicle..
I don't know why, here is my code..
Hi, I have made command /veh, to create vehicle..
Код:
format(string, 128, " You have spawned vehicle| ID: %d, Model: %d", crVeh, model); SCM(playerid,WHITE,string); // Code above is being called, it sends me a message You have spawned... //-------------- // Code below is NOT being called, idk why, tried to use different string, not making a sense.. format(string, 128, "Admin %s has spawned %s", RPname(playerid), GetVehicleName(model)); SendAdminMessage(1, TOMATO, string); printf("admin %s | created vehicle %s | id: %d", RPname(playerid), GetVehicleName(model), crVeh);
pawn Код:
YCMD:veh(playerid, params[], help)
{
#pragma unused help
if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid,DARKRED,"[CA:RP]"gray" Admins only!");
new model,col1,col2;
if(sscanf(params, "iii", model, col1,col2)) return SCM(playerid, GRAY,"Usage: /veh [model] [Color1] [Color2]");
else if(model < 400 || model> 611) return SCM(playerid, GRAY,"Wrong vehicle model (400-611)");
new Float:x,Float:y,Float:z,crVeh,string[128];
GetPlayerPos(playerid,x,y,z);
crVeh = CreateVehicle(model,x,y,z,0,col1,col2,-1);
PutPlayerInVehicle(playerid, crVeh, 0);
CarCreated[crVeh] = 1;
SetVehicleNumberPlate(crVeh,"Admin Car");
format(string, 128, " You have spawned vehicle | ID: %d, Model: %d", crVeh, model);
SCM(playerid,WHITE,string);
format(string, 128, "Admin %s has spawned %s", RPname(playerid), GetVehicleName(model));
SendAdminMessage(1, TOMATO, string);
printf("admin %s | created vehicle %s | id: %d", RPname(playerid), GetVehicleName(model), crVeh);
return 1;
}