SA-MP Forums Archive
Cp with command... - 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: Cp with command... (/showthread.php?tid=112797)



Cp with command... - TouR - 10.12.2009

Can someone tell me how to make a checkpoint that if someone is on it and write /robatm gets 1000$?


Re: Cp with command... - Jeffry - 10.12.2009

Hmm, you could try it with IsPlayerInArea, but im not sure how it works...
Check the tutorial...


Re: Cp with command... - Mikep. - 10.12.2009

Quote:
Originally Posted by Jeffry
Hmm, you could try it with IsPlayerInArea, but im not sure how it works...
Check the tutorial...
IsPlayerInCheckpoint..?


Re: Cp with command... - DJDhan - 10.12.2009

Код:
public OnPlayerSpawn(playerid)
{
new atm=SetCheckpoint(playerid,x,y,z,sizeofcheckpoint); good size can be 2 to 8.
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/robatm", true, 7))
{ if(IsPlayerInCheckPoint(playerid)==1);
  GivePlayerMoney(playerid,1000); whatever amount you want
 return 1;
}
You can use OnplayerEnterCheckpoint too. Not sure but may work.


Re: Cp with command... - LarzI - 10.12.2009

better version of code above:

Ontop:
pawn Код:
new
  g_moneyCP;
OnPlayerSpawn:
pawn Код:
public OnPlayerSpawn(playerid)
{
  g_moneyCP = SetPlayerCheckpoint( playerid, x, y, z, size ); //I recommend size from 2.0-7.0
  return true;
}
Then the command:
pawn Код:
if( !strcmp( cmdtext, "/robatm", true ) )
{
  if( IsPlayerInCheckpoint( playerid ) == g_moneyCP )
    return GivePlayerMoney( playerid, 1000 );
  return false;
}




Re: Cp with command... - Correlli - 10.12.2009

Quote:
Originally Posted by lrZ^ aka LarzI
pawn Код:
if( IsPlayerInCheckpoint( playerid ) == g_moneyCP )
Are you sure this is going to work? Because i don't think it will.