SA-MP Forums Archive
how do i make as /goto cmd?? - 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: how do i make as /goto cmd?? (/showthread.php?tid=231484)



how do i make as /goto cmd?? - [EDT]AmanSingh123 - 25.02.2011

how do i make a goto cmd so if i do /goto 1 and it teles me to id 1 and also how do i make something in my gamemode that when i press '2' on my keyboard my car automaticly fixes??

please i need help


Re: how do i make as /goto cmd?? - Mean - 25.02.2011

Zcmd.
GOTO:
pawn Код:
CMD:goto( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) )
        return 0;
    new giveplayerid;
    giveplayerid = strval( params );
    if( !strlen( params ) )
        return SendClientMessage( playerid, 0xAAAAAA, "Usage: /GOTO [ID]" );
    if( giveplayerid == INVALID_PLAYER_ID || !IsPlayerConnected( giveplayerid ) )
        return SendClientMessage( playerid, 0xAAAAAA, "Invalid ID" );
    new Float:pos[ 2 ];
    GetPlayerPos( giveplayerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
    SetPlayerPos( playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
    new string[ 128 ];
    GetPlayerName( giveplayerid, string, sizeof string );
    format( string, sizeof string, "You have teleported to [%d]%s", giveplayerid, string );
    SendClientMessage( playerid, 0xAAAAAA, string );
    return 1;
}



Re : how do i make as /goto cmd?? - timaoux - 30.07.2011

C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 029: invalid expression, assumed zero
C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 017: undefined symbol "cmd_goto"
C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 029: invalid expression, assumed zero
C:\Users\maxime\Desktop\cmdclan.pwn(97) : fatal error 107: too many error messages on one line

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


4 Errors.


Re: how do i make as /goto cmd?? - Kush - 30.07.2011

PHP код:
CMD:goto(playeridparams[])
{
    new 
ID;
    new 
Str[64];
    if(
sscanf(params"u"ID)) SendClientMessage(playeridCOLOR_GREY"USAGE: /goto [playerid]");
    else if(
IsPlayerConnected(ID) == 0SendClientMessage(playeridCOLOR_GREY"Player is not connected!");
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(IDxyz);
    
SetPlayerPos(playeridx+1y+1z);
    return 
1;

Even shorter.


Re: how do i make as /goto cmd?? - Guest3598475934857938411 - 30.07.2011

About the errors, just get the ZCMD include.
Here's a link: https://sampforum.blast.hk/showthread.php?tid=91354

Hope I helped.


Re : how do i make as /goto cmd?? - timaoux - 31.07.2011

i got the same error with zcmd and sscanf


Re : how do i make as /goto cmd?? - timaoux - 31.07.2011

i found how