Help. Teleport SSCANF [URGENT]
#1

Can someone send me the code of /teleport lv/sf/ls.
The code should be made ONLY USING SSCANF AND ZCMD. NOT STRCMP.
If player writes lv then he gets teleported to lv.
Reply
#2

Help me urgent
Reply
#3

This isn't that hard to make. Simply go in-game, go to the spawn point and type in /save.

Go to your GTA San Andreas user Files in Documents, open SAMP and open up savedpositions.txt and look for the X Y Z code.

Example: AddPlayerClass(0,-2919.3940, 2055.7629, 8.7861, 269.5200,0,0,0,0,0,0);. What I've put in bold is all you need!

Copy the coordinates and then use SetPlayerPos to teleport them.

To make commands using zcmd:

Код:
COMMAND:mycommand(playerid, params[]) // or CMD:mycommand(playerid, params[]) 
{
    // Do something
    return 1; 
}
More about zcmd can be found out on the thread: https://sampforum.blast.hk/showthread.php?tid=91354
Reply
#4

i have the same problem. I understood what Freaked said but my question is how to write in script if player choses lv he'll get teleported to LV. What function shall I use ? Can you give me a part of the code ?
Reply
#5

PHP код:
#define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
CMD:teleport(playeridparams[]) {
    if(
isnull(params)) return SendClientMessage(playerid, -1"/teleport <name>!");
    if(!
strcmp(params"LV"true)) {
        
//Teleport to LV
    
}
    else if(!
strcmp(params"LS"true)) {
        
//Teleport to LS
    
}
    else 
SendClientMessage(playerid, -1"Not a valid teleport name!");
    return 
1;

Not tested.
Reply
#6

Only SSCANF and ZCMD.
Reply
#7

That is ZCMD, and theres no point of using sscanf.
And sscanf only parses arguments it doesn't check if hello == hello.
Reply
#8

Using that define is necessary ?
Reply
#9

Well of course unless you don't want the player to be notified of the command arguments.
Reply
#10

isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))

What does that mean ?
And can we use something else instead of this hard, weird letters ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)