rep again 2
#1

Ok
How To make /goto and /get command?
how to fix this ?
pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\RolePlay\FilterScripts\RANKS.pwn(141) : error 075: input line too long (after substitutions)
C:\Users\carlo\Desktop\SA-MP Server\RolePlay\FilterScripts\RANKS.pwn(142) : error 037: invalid string (possibly non-terminated string)
C:\Users\carlo\Desktop\SA-MP Server\RolePlay\FilterScripts\RANKS.pwn(142) : error 017: undefined symbol "Trainee"
C:\Users\carlo\Desktop\SA-MP Server\RolePlay\FilterScripts\RANKS.pwn(142) : error 029: invalid expression, assumed zero
C:\Users\carlo\Desktop\SA-MP Server\RolePlay\FilterScripts\RANKS.pwn(142) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
pawn Код:
CMD:ranks(playerid, params[])
{
    ShowPlayerDialog(playerid, 12516, DIALOG_STYLE_MSGBOX," RANKS ","Trainee \t 0 - 100 \n Private \t 101 - 200 \n PFC \t 201 - 300 \n Corporal \t 301 - 400 \n Sergeant \t 301 - 400 \n Staff Sergeant \t 401 - 500 \n SFC \t 501 - 600 \n Master Sergeant \t 601 - 700 \n Second Lieutenant \t 701 - 800 \n First Lietenant \t 801 - 900 \n Captain \t 901 - 1000 \n Major \t 1001 - 1200 Lieutenant Colonel \t 1201 - 1400 \n Colonel \t 1401 - 1600 \n Brigadier General \t  1601 - 2000 \n Major General \t 2001 - 2400 \n Lieutenant General \t 2401 - 2800 \n General \t 2801 - 3500 \n Marshal \t 3501+ \n","Okay");
    return 1;
}
Fvckthis shit
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 4 seconds.
Reply
#2

****** tutorials for /goto and /getto, there is many that have been made. Also, that string parameter is too long, you'll have to use strcat.
Reply
#3

Like he said, dialog is too long. Make it so there is more than one page (next button that goes to the next dialog). Also, please stop titling the post "rep", the title should be the overall problem you are having (rules/guidelines).
Reply
#4

Quote:
Originally Posted by Lutz
Посмотреть сообщение
Like he said, dialog is too long.
That's not the point actually. You can only have a limited amount of characters in ONE string. You can make super long dialogs like this.
pawn Код:
new szDialog[1200];
for(new i=0; i<500; i++)
{
    format(szDialog, 1200, "%sDialog", szDialog);
}
ShowPlayerDialog(playerid, 1, DIALOG_MSGBOX, "DIALOG", szDialog, "Yes", "No");
Quote:
Originally Posted by Lutz
Посмотреть сообщение
Also, please stop titling the post "rep", the title should be the overall problem you are having (rules/guidelines).
Agreed.
Reply
#5

But How? Can You make It For me ??
Reply
#6

pawn Код:
CMD:goto(playerid,params[])
{
    new id, Float:X,Float:Y,Float:Z,str[128],pName[32],vName[32];
    if(pInfo[playerid][Adminlevel] >= 1)
    {
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"Usage: /goto [id]");
        if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
        GetPlayerName(playerid,pName,32);
        GetPlayerName(id,vName,32);
        GetPlayerPos(id,X,Y,Z);
        SetPlayerPos(playerid,X+3,Y+2,Z);
        format(str,sizeof(str),"You have teleported to Player %s",vName);
        SendClientMessage(playerid,COLOR_RED1,str);
        format(str,sizeof(str),"Admin %s[%i] Has Teleported To Player %s[%i] ",pName,playerid,vName,id);
        SendClientMessageToAll(COLOR_BLUE,str);
    }
    else
    {
        SendClientMessage(playerid,COLOR_RED1,"You May not use this command");
    }
    return 1;
}
CMD:get(playerid,params[])
{
    new id, Float:X,Float:Y,Float:Z,str[128],pName[32],vName[32];
    if(pInfo[playerid][Adminlevel] >= 1)
    {
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"Usage: /get [id]");
        if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
        GetPlayerName(playerid,pName,32);
        GetPlayerName(id,vName,32);
        GetPlayerPos(playerid,X,Y,Z);
        SetPlayerPos(id,X+3,Y+2,Z);
        format(str,sizeof(str),"Admin %s[%i] Has Teleported Player %s[%i] to him ",pName,playerid,vName,id);
        SendClientMessageToAll(COLOR_GREEN,str);
    }
    else
    {
        SendClientMessage(playerid,COLOR_RED1,"You May not use this command");
    }
    return 1;
}
here you go but this is from my admin system.
Reply
#7

Not That The Dialogs
Reply
#8

/goto
pawn Код:
CMD:goto(playerid,params[]) {
    if(PlayerInfo[playerid][pLevel] >= 2 || IsPlayerAdmin(playerid)) {
        if(isnull(params)) return SendClientMessage(playerid,RED,"USAGE: /goto [playerid]");
        new player1, string[128];
        if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
        else player1 = strval(params);
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
            CMDMessageToAdmins(playerid,"GOTO");
            new Float:x, Float:y, Float:z;  GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
            if(GetPlayerState(playerid) == 2) {
                SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);    LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
            } else SetPlayerPos(playerid,x+2,y,z);
            format(string,sizeof(string),"You have been teleported to \"%s\"", PlayerName2(player1));
            return SendClientMessage(playerid,CMDBLUE,string);
        } else return SendClientMessage(playerid, RED, "Player is not connected or is yourself");
    } else return SendClientMessage(playerid,RED,"ERROR: You are not a high enough level to use this command");
}
/get
pawn Код:
CMD:get(playerid,params[]) {
if(PlayerInfo[playerid][pLevel] >= 2|| IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, RED, "USAGE: /get [playerid]");
new player1, string[128];
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
else player1 = strval(params);
if(PlayerInfo[player1][pLevel] == MAX_ADMINL && PlayerInfo[playerid][pLevel] != MAX_ADMINL) return SendClientMessage(playerid,RED,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
CMDMessageToAdmins(playerid,"GET");
new Float:x, Float:y, Float:z;  GetPlayerPos(playerid,x,y,z); SetPlayerInterior(player1,GetPlayerInterior(playerid));
SetPlayerVirtualWorld(player1,GetPlayerVirtualWorld(playerid));
if(GetPlayerState(player1) == 2)    {
new VehicleID = GetPlayerVehicleID(player1);
SetVehiclePos(VehicleID,x+3,y,z);   LinkVehicleToInterior(VehicleID,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(player1),GetPlayerVirtualWorld(playerid));
} else SetPlayerPos(player1,x+2,y,z);
format(string,sizeof(string),"Administrator \"%s\" has teleported you to his location", PlayerName2(playerid) );    SendClientMessage(player1,CMDBLUE,string);
format(string,sizeof(string),"You have teleported \"%s\" to your location", PlayerName2(player1) );
return SendClientMessage(playerid,CMDBLUE,string);
} else return SendClientMessage(playerid, RED, "Player is not connected or is yourself");
} else return SendClientMessage(playerid,RED,"ERROR: You are not a high enough level to use this command");
}
Take help from above codes.. (credits to lethal!)
Reply
#9

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
/goto
pawn Код:
CMD:goto(playerid,params[]) {
    if(PlayerInfo[playerid][pLevel] >= 2 || IsPlayerAdmin(playerid)) {
        if(isnull(params)) return SendClientMessage(playerid,RED,"USAGE: /goto [playerid]");
        new player1, string[128];
        if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
        else player1 = strval(params);
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
            CMDMessageToAdmins(playerid,"GOTO");
            new Float:x, Float:y, Float:z;  GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
            if(GetPlayerState(playerid) == 2) {
                SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);    LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
            } else SetPlayerPos(playerid,x+2,y,z);
            format(string,sizeof(string),"You have been teleported to \"%s\"", PlayerName2(player1));
            return SendClientMessage(playerid,CMDBLUE,string);
        } else return SendClientMessage(playerid, RED, "Player is not connected or is yourself");
    } else return SendClientMessage(playerid,RED,"ERROR: You are not a high enough level to use this command");
}
/get
pawn Код:
CMD:get(playerid,params[]) {
if(PlayerInfo[playerid][pLevel] >= 2|| IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, RED, "USAGE: /get [playerid]");
new player1, string[128];
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
else player1 = strval(params);
if(PlayerInfo[player1][pLevel] == MAX_ADMINL && PlayerInfo[playerid][pLevel] != MAX_ADMINL) return SendClientMessage(playerid,RED,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
CMDMessageToAdmins(playerid,"GET");
new Float:x, Float:y, Float:z;  GetPlayerPos(playerid,x,y,z); SetPlayerInterior(player1,GetPlayerInterior(playerid));
SetPlayerVirtualWorld(player1,GetPlayerVirtualWorld(playerid));
if(GetPlayerState(player1) == 2)    {
new VehicleID = GetPlayerVehicleID(player1);
SetVehiclePos(VehicleID,x+3,y,z);   LinkVehicleToInterior(VehicleID,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(player1),GetPlayerVirtualWorld(playerid));
} else SetPlayerPos(player1,x+2,y,z);
format(string,sizeof(string),"Administrator \"%s\" has teleported you to his location", PlayerName2(playerid) );    SendClientMessage(player1,CMDBLUE,string);
format(string,sizeof(string),"You have teleported \"%s\" to your location", PlayerName2(player1) );
return SendClientMessage(playerid,CMDBLUE,string);
} else return SendClientMessage(playerid, RED, "Player is not connected or is yourself");
} else return SendClientMessage(playerid,RED,"ERROR: You are not a high enough level to use this command");
}
Take help from above codes.. (credits to lethal!)
My eyes are burning, do you know what code identation IS?AND STOP posting the code, let this guy LEARN use the search function and WIKIPedia.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)