Converting from Format to SendClientMessage? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Converting from Format to SendClientMessage? (
/showthread.php?tid=113204)
Converting from Format to SendClientMessage? -
Studio - 12.12.2009
pawn Код:
format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
SaveToFile("CarSpawns",string);
format(string, sizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
Converting from Format to SendClientMessage?
Thanks, it'd be much appreciated if anyone could help.
Re: Converting from Format to SendClientMessage? -
Studio - 12.12.2009
Also, this command does not appear to be working.
pawn Код:
dcmd_spawncar(playerid,params[]) {
if(PlayerData[playerid][AdminLevel] >= 2) {
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /spawncar [Modelid/Name] [colour1] [colour2]");
new car, colour1, colour2, string[128];
if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Vehicle Model");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);
LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
return SendClientMessage(playerid,COLOR_WHITE, string);
} else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be level 2 to use this command");
}
Re: Converting from Format to SendClientMessage? -
NeRoSiS - 13.12.2009
SendClientMessage(playerid, color, string);