String help [URGENT]
#1

PHP код:
CMD:teleport(playeridparams[]) {
    if(
isnull(params)) return SendClientMessage(playerid, -1"/teleport [Name] (Name = Bayside/Octane Springs!");
    if(!
strcmp(params"Bayside"true)) {
        
SetPlayerPos(playerid, -2455.5942,2254.1738,4.9807);
        
SetPlayerFacingAngle(playerid0);
        
SetPlayerVirtualWorld(playerid1);
        
format(stringSOS"You have been teleported to Bayside Warehouse!");
        
SendClientMessage(playeridgreenstring);
    }
    else if(!
strcmp(params"Octane Springs"true)) {
        
SetPlayerPos(playerid397.8003,1157.7520,8.3481);
        
SetPlayerFacingAngle(playerid0);
        
SetPlayerVirtualWorld(playerid1);
        
format(stringSOS"You have been teleported to Octane Springs!");
        
SendClientMessage(playeridgreenstring);
    }
    else 
SendClientMessage(playerid, -1"Not a valid teleport name! (Available Teleport names - Bayside and Octane Springs");
    return 
1;

I need SSCANF and ZCMD instead of strcmp no matter what. Please send SSCANF and ZCMD not strcmp one.
Reply
#2

Its good, strcmp is using for text detection... if you want to put sscanf for "%d" you will need to type /teleport 1-2
Reply
#3

How can i do so ? Can you send a part of he code ?
Reply
#4

Код:
if(sscanf(params, "i",teleport)) return SCM(playerid,-1,"Use: /teleport (number)");
Код:
switch(teleport)
{
case 1:
{
//teleport code for 1 put here
}
case 2:
{
//teleport code for 2 put here
}
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)