Posts: 44
Threads: 5
Joined: Jun 2015
Reputation:
0
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.
Posts: 16
Threads: 6
Joined: Oct 2015
Reputation:
0
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 ?
Posts: 1,276
Threads: 6
Joined: Aug 2014
PHP код:
#define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
CMD:teleport(playerid, params[]) {
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.
Posts: 1,276
Threads: 6
Joined: Aug 2014
That is ZCMD, and theres no point of using sscanf.
And sscanf only parses arguments it doesn't check if hello == hello.
Posts: 16
Threads: 6
Joined: Oct 2015
Reputation:
0
Using that define is necessary ?
Posts: 1,276
Threads: 6
Joined: Aug 2014
Well of course unless you don't want the player to be notified of the command arguments.
Posts: 16
Threads: 6
Joined: Oct 2015
Reputation:
0
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 ?