Help with this script, Please?
#1

I'm very new to scripting; I'm attempting to make this script available to GM's level 2 + and Admins level 6 +.

Mind giving me a hand? I get errors :]

Код:
	if(strcmp(cmd, "/kcc", true) == 0) {
	{
	if(IsPlayerConnected(playerid))
	}
	new v;
	new i;
	new Float:temp;
	new Float:Pos[6];
	new closest = INVALID_VEHICLE_ID;
	new Float:distance = (Float:0x7F800000);
	if (PlayerInfo[playerid][pAdmin] >= 6 || PlayerInfo[playerid][pGM] >= 2)
		{
	GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	while((++v) != MAX_VEHICLES) {
		if(GetVehiclePos(v, Pos[3], Pos[4], Pos[5])) {
			Pos[3] -= Pos[0];
			Pos[4] -= Pos[1];
			Pos[5] -= Pos[2];
			temp = ((Pos[3] * Pos[3]) + (Pos[4] * Pos[4]) + (Pos[5] * Pos[5]));
			if(temp < distance) {
				for(i = 0; i != MAX_PLAYERS; i++) {
					if(GetPlayerVehicleID(i) == v) {
						break;
					}
				}
				if(i == MAX_PLAYERS) {
					closest = v;
					distance = temp;
				}
			}
		}
	}
	return SetVehicleToRespawn(closest);
}
	else if
		{
		SendClientMessage(playerid, COLOR_GRAD1, "You are not a Level 2 GM+!");
		}
		return 0;
}
Quote:

C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(3816) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(3845) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(3881) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(3882) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(3909) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4205) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4209) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4217) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4239) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4546) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4557) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4569) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4573) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4585) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4589) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4593) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4597) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4601) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4605) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4609) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4613) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4625) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4629) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4633) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4637) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Eric\Desktop\samp03asvr_R7_win32\gamemode s\ngrp.pwn(4641) : error 004: function "PlayerToPoint" is not implemented

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

Help, Please!

Thanks in advance!

- Eric
Reply
#2

check your script for missing brackets, or too much.
' {} '
Reply
#3

I did look over it, couldn't find anything :/

Mind giving me a hand? :]
Reply
#4

Whoa, your closing it wrong. First of all, the 'else if' saying you arent admin should be 'else'
Reply
#5

i think this should do the job:
pawn Код:
if(strcmp(cmd, "/kcc", true) == 0) {
        if(IsPlayerConnected(playerid)){
            new v;
            new i;
            new Float:temp;
            new Float:Pos[6];
            new closest = INVALID_VEHICLE_ID;
            new Float:distance = (Float:0x7F800000);
            if (PlayerInfo[playerid][pAdmin] >= 6 || PlayerInfo[playerid][pGM] >= 2){
                GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
                while((++v) != MAX_VEHICLES) {
                    if(GetVehiclePos(v, Pos[3], Pos[4], Pos[5])) {
                        Pos[3] -= Pos[0];
                        Pos[4] -= Pos[1];
                        Pos[5] -= Pos[2];
                        temp = ((Pos[3] * Pos[3]) + (Pos[4] * Pos[4]) + (Pos[5] * Pos[5]));
                        if(temp < distance) {
                            for(i = 0; i != MAX_PLAYERS; i++) {
                                if(GetPlayerVehicleID(i) == v) {
                                    break;
                                }
                            }
                            if(i == MAX_PLAYERS) {
                                closest = v;
                                distance = temp;
                            }
                        }
                    }
                }
                return SetVehicleToRespawn(closest);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "You are not a Level 2 GM+!");
            }
            return 1;
        }
        return 0;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)