Help please +Rep for correct Helper ;)
#1

Код:
if (strcmp(cmd, "/savep", true)==0) {
	if (!IsPlayerAdmin(playerid)) return 1;
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp)) {
		SendClientMessage(playerid, COLOR_ORANGE, "Usage: /savep name | \"\" will be auto added");
		return 1;
	}
		new Float:x, Float:y, Float:z, Float:a;
		GetPlayerPos(playerid, x, y, z);
		GetPlayerFacingAngle(playerid, a);
		format(string, sizeof(string), "{\"%s\", {%0.2f, %0.2f, %0.2f}},", tmp, x+2, y, z);
		SaveToFile2("HuntCheckpoint",string); // you can change it...
		return SendClientMessage(playerid, -1, string);
	}
	else SendClientMessage(playerid, -1, "Error: You are not authorized to use that command!");
}
How can i convert this into dcmd or zcmd or can u please provide code ?
Reply
#2

pawn Код:
CMD:savep(playerid, params[])
{
    if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Error: You are not authorized to use that command!");

    if(isnull(params))
    {
        SendClientMessage(playerid, COLOR_ORANGE, "Usage: /savep name | \"\" will be auto added");
        return 1;
    }
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    format(string, sizeof(string), "{\"%s\", {%0.2f, %0.2f, %0.2f}},", params, x+2, y, z);
    SaveToFile2("HuntCheckpoint",string); // you can change it...
    return SendClientMessage(playerid, -1, string);
}
Use search next time
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)