commandtext....
#1

hello,
i am having a problem with adding a new command.
i already have this, and this works:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
 {
  if(!strcmp(cmdtext,"/fix",true)) {
    if(IsPlayerAdmin(playerid) && IsPlayerInAnyVehicle(playerid)) {
      SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
    } else {
      SendClientMessage(playerid,COLOR_CRED,"You must be an administrator AND be inside a vehicle to use this command.");
    }
    return 1;
  }
  return 0;
}
but how can i this into there now?:
Код:
if(!strcmp("/Enter", cmdtext, true) && PlayerToPoint(1.5 ,playerid,252.8745,-92.3390,3.5354))
 {
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,262.1704,-84.3840,65.1329);
	CreatePickup(1239,2,252.8745,-92.3390,3.5354);
	return 1;
 }
 if(!strcmp("/Exit", cmdtext, true) && PlayerToPoint(1.5 ,playerid,262.1704,-84.3840,65.1329))
 {
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,252.8745,-92.3390,3.5354);
	return 1;
 	}
 return 0;
 }
i just started a new server, so this are the only commands in this script from now. i hope you can help me.

thuron
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
 {
  if(!strcmp(cmdtext,"/fix",true))
  {
    if(IsPlayerAdmin(playerid) && IsPlayerInAnyVehicle(playerid))
    {
      SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
    }
    else
    {
      SendClientMessage(playerid,COLOR_CRED,"You must be an administrator AND be inside a vehicle to use this command.");
    }
    return 1;
  }
  if(!strcmp("/Enter", cmdtext, true) && PlayerToPoint(1.5 ,playerid,252.8745,-92.3390,3.5354))
  {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,262.1704,-84.3840,65.1329);
    CreatePickup(1239,2,252.8745,-92.3390,3.5354);
    return 1;
  }
  if(!strcmp("/Exit", cmdtext, true) && PlayerToPoint(1.5 ,playerid,262.1704,-84.3840,65.1329))
 {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,252.8745,-92.3390,3.5354);
    return 1;
 }
 return 0;
}
Reply
#3

Come on theron, you always keep asking same things.
why don't you just learn scripting, search on wiki, think before asking.
Reply
#4

just started, relaxt man.

But that wont work, got 2 errors, tryed it like this to, but even wont work:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
 {
  if(!strcmp(cmdtext,"/fix",true)) {
    if(IsPlayerAdmin(playerid) && IsPlayerInAnyVehicle(playerid)) {
      SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
    } else {
      SendClientMessage(playerid,COLOR_CRED,"You must be an administrator AND be inside a vehicle to use this command.");
    }
    return 1;
  }
  if(!strcmp("/Enter", cmdtext, true) && PlayerToPoint(1.5 ,playerid,252.8745,-92.3390,3.5354))
  {
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,262.1704,-84.3840,65.1329);
CreatePickup(1239,2,252.8745,-92.3390,3.5354);
return 1;
  }
  if(!strcmp("/Exit", cmdtext, true) && PlayerToPoint(1.5 ,playerid,262.1704,-84.3840,65.1329))
 {
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,252.8745,-92.3390,3.5354);
return 1;
 }
 return 0;
}
got those errors:
Код:
C:\Users\thuron\Desktop\SIR server\gamemodes\SIRRP.pwn(440) : warning 217: loose indentation
C:\Users\thuron\Desktop\SIR server\gamemodes\SIRRP.pwn(446) : warning 217: loose indentation
instead of telling me to search wiki, tell me rks!
Reply
#5

search pawn documentation

it means you haven't aligned the text in your code properly, nothing serious
Reply
#6

well that are comments that are usefull!! thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)