Simple question - 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)
+--- Thread: Simple question (
/showthread.php?tid=476820)
Simple question -
whando - 20.11.2013
Код:
CMD:createspeedcam(playerid, params[])
{
new maxspeed;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "d", maxspeed)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createspeedcam [Speed]");
AddSpeedCam(playerid, maxspeed);
LoadSpeedCams();
SendClientMessage(playerid, COLOR_ORANGE, "You've added a speedcam at your position");
return 1;
}
My friend made this, but what scripting language is it? zcmd, ycmd?? Which of all?
Re: Simple question -
Konstantinos - 20.11.2013
You do mean command processor - it's ZCMD.
Re: Simple question -
whando - 20.11.2013
Yea I just found out, sorry for this dumb question and thanks for your help!
Re: Simple question -
whando - 20.11.2013
Код:
CMD:createspeedcam(playerid, params[])
{
new maxspeed;
if(PlayerInfo[playerid][pAdmin] == 6)
if(sscanf(params, "d", maxspeed)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createspeedcam [Speed]");
AddSpeedCam(playerid, maxspeed);
LoadSpeedCams();
SendClientMessage(playerid, COLOR_ORANGE, "You've added a speedcam at your position");
return 1;
}
Код:
public SpeedCamsTimer(){
new String[256], Float:tmpX, Float:tmpY;
for(new i = 0; i < MAX_PLAYERS; i++){
new State = GetPlayerState(i);
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && GetPlayerSpeed(i, true) > 0 && State == PLAYER_STATE_DRIVER){
for(new p = 0; p < MAX_SPEEDCAMS; p++){
tmpX = SpeedCams[p][scx];
tmpY = SpeedCams[p][scy];
GetDirectedXY(2, p, tmpX, tmpY, 5.0, 1);
if(IsPlayerInRangeOfPoint(i, 20.0, tmpX, tmpY, SpeedCams[p][scz])){
new CSpeed;
CSpeed = GetPlayerSpeed(i, true);
if(CSpeed > SpeedCams[p][scmaxspeed] && SpeedCamPlayer[i] == 0){
SpeedCamPlayer[i] = 1;
TextDrawShowForPlayer(i, radarTD[i]);
SetTimerEx("RemoveRadarTD",1000, false, "i", i);
format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))", CSpeed, SpeedCams[p][scmaxspeed]);
SendClientMessage(i, COLOR_RED, String);
SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
}
}
}
}
}
}
Could you please convert these to dini(strcmp)? I tried multiple ways but keep getting 26 errors :/
Re: Simple question -
whando - 21.11.2013
Anyone?..
Re: Simple question -
newbie scripter - 21.11.2013
Check brackets